if statement nested in a while loop

Hi everyone I am taking my first programming class(c++) and I am having trouble compiling because of one syntex error! Can someone have a look? Any sugguestions would be appreciated.

#include <iostream.h>
#include <conio.h>
#include <iomanip.h>


int main()
{ double salary;
double sales = 0;
double rate1 =.07;
double rate2 =.05;


clrscr();


cout << "\n\nAmber D.Currie Program 3";
cout <<"\n\n\nEnter Gross Sales amount(-1 to stop):"<<setw(6);
cin >>sales;



while (sales != -1)
{ cout <<"Enter Gross Sales Amount(-1 to stop):";
cin >>sales;
salary= salary + sales;

if (sales >= 5000)
salary = ((sales * rate1) + 250);
else
salary = ((sales * rate2) + 200);

cin>> sales;
} //end while



cout <<"\n\nSales:" <<setw(6)<<setiosflags(ios::fixed)<<setprecision(2)<<sales;
<<"\n\nSalary:" <<setw(6)<<setiosflags(ios::fixed)<<setprecision(2)<<salary;


gotoxy(1,24);
return 0;
} //main()
Last edited on
if you are an Windows user there must to be:
1
2
3
4
5
6
7
8
9
10
11
#include <iosteam>
#include <conio>
#include <iomainp>

using namespace std ;
int main ()
{
double salary;
double sales ;
. . . . . . . . . . . . 

and not
1
2
3
4
5
6
7
8
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
int main()
{ double salary;
double sales = 0;
double rate1 =.07;
double rate2 =.05;
Thanks pauliancu, I made the changes and inserted the decimal values where the rates were and there is still a syntex error.
Could you post the syntax error(ps, pauliancu that's code style not syntax)
This is the error
Error E2188 p03.43:Expression syntex in function main()
***1 errors in Compile*****
Topic archived. No new replies allowed.