When you get a bunch of errors, always start with the first one first. Fix the error, compile the code, and if there are still errors, again fix the first error first, ... and eventually you should have no compiler errors left.
The first error here has to do with a missing semicolon on line 9.
First, the name of the product is a string, so the data type for that variable should be string .
Also, setting all the price types as int truncates the fractional part of the results after the computation of profitPercentage .
Declare them as double or float.
In line 9, you left out a semicolon after the declaration of profitPercentage .
After having declared productName as string ,
use the comands:
1 2 3 4 5
cin>>productName; //must include <string> library.
//stop input after space. You can experiment.
getline(cin,productName); // <string> library.
//stop input at new line (enter)
I cant say if everything looks good or not.
If the program works the way you want Fine. It then looks good. Else, polish it to your taste.
We will be here to help you accomplish that.
One way to fix it is to ask them to not have any space and to do underscore 'ball_pen'
1 2 3 4
cout<<"Please do not enter any spaces instead use underscore in the product's name =D<<endl;
cout << "Enter the name of the product:\n";
cin >> productName;