Answer to Question #288792 in C++ for ali

Question #288792

 You have been hired to write software for a point of sale terminal of a shop dealing in secondhand stuff. This shop has very unusual and unique business rules. The prices of products change now and then and since the items they sell are used; they don't even have any codes on them. Hence, prices are to be specified each time a product is sold. All you are required to do is to generate the bill for each sale. Your program should start by displaying the following menu. 1.New Sale 2. Exit The program exits, if that is chosen from the menu. However, for new sale, your program reads the price and quantity of the product(store in 2D array)and asks the user if he/she wants to add more items.It keeps on reading data for all items in the sale as many times as the user wishes.Your program should also keep one displaying the running total after adding each item to the current sale. In the end the total Bill is displayed, cash paid is recorded and balance is shown.



1
Expert's answer
2022-01-20T01:46:13-0500
#include<iostream>

using namespace std;

int main()
{
	int N;
	cout << "Please, a number of elements: ";
	cin >> N;
	int* arr = new int[N];
	cout << "Enter elements: ";
	for (int i = 0; i < N; i++)
	{
		cin>> arr[i];
	}
	cout << "\nThe even numbers are ";
	for (int i = 0; i < N; i++)
	{
		if (arr[i] % 2 == 0)
			cout << arr[i] << " ";
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog