Feb 28, 2010 at 4:23pm UTC
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 Feb 28, 2010 at 7:45pm UTC
Feb 28, 2010 at 7:29pm UTC
Thanks pauliancu, I made the changes and inserted the decimal values where the rates were and there is still a syntex error.
Feb 28, 2010 at 8:04pm UTC
Could you post the syntax error(ps, pauliancu that's code style not syntax)
Feb 28, 2010 at 8:20pm UTC
This is the error
Error E2188 p03.43:Expression syntex in function main()
***1 errors in Compile*****