Hello I am new to c++ and I am trying to run a simple sales program. All the program has to do is run a program that reads the series of pairs of numbers as follows:
A. product number
B. Quantity sold for one day
The program must have the switch statement to help determine the retail price for each product and program should calculate and display the total retail value of all products sold last week.
I have the code completely done but the program wont recognized the following characters. count, cin, and end1. Here is the code.
You could use usingnamespace std; but that would pull in the entire std namespace. This is not generally considered good practice - it could lead to name clashes.
Much better is to selectively choose the members of std that you want to use:
1 2 3
using std::cout;
using std::cin;
using std::endl;
Or you can simply make sure you properly qualify the namespaces when you use the symbols, e.g.
1 2 3 4
std::cout << "Enter the product number (1-5) (0 to Stop): ";
std::cin >> ProductNumber;
std::cout << "Enter quantity sold: ";
std::cin >> QuantitySold;
okay I did that and it worked, but now every time I when I enter the number of items sold it just gives me the same amount the item cost and when I do the switch the program it just loops forever.