Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Basic C++ Question!

$
0
0

I am getting the error: 

1>c:\users\kelsey\documents\visual studio 2013\projects\project3\project3\payroll program reading from filecpp(52): error C2143: syntax error : missing ';' before '}'

Can anyone see where I am missing it?? Thanks!! 

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

int main(int argc, const char * argv[])
{
ifstream input;
input.open("text.txt");

int employeeid, numberofemployees;
float hourlyrate, grosspay, hoursworked , taxamount, netpay;
float taxrate=0;
char taxstatus[2];

numberofemployees=0;

while (input>>employeeid>>hoursworked>>hourlyrate>>taxstatus){

grosspay = hoursworked*hourlyrate;

if (grosspay > 1000) taxrate= 0.30;
else if (grosspay > 800 ) taxrate=  0.20;
else if (grosspay > 500) taxrate = 0.10;
else taxrate=0.0;
ifstream input;
if ((((strcmp(taxstatus, "H")==0)) ((strcmp(taxstatus, "h")==0)))&& (grosspay>500)){
taxrate=taxrate-.05;
}
ifstream input;
if ((((strcmp(taxstatus, "S")==0)) ((strcmp(taxstatus, "s")==0))){
taxrate=taxrate-.05;
}
ifstream input;
if ((((strcmp(taxstatus, "M")==0)) ((strcmp(taxstatus, "m")==0))){
taxrate=taxrate-.05;
}
taxamount=grosspay*taxrate;
netpay=grosspay-taxamount;
cout<<"THE EMPLOYEE ID IS:"<< employeeid << endl;
cout<<"THE HOURS WORKED ARE:" <<hoursworked<<endl;
cout<<"THE HOURLY RATE IS:"<< hourlyrate<<endl;
cout<<"THE GROSS PAY IS:" <<grosspay<<endl;
cout<<"THE TAXAMOUNT IS:"<< taxamount<<endl;
cout<<"THE NET PAY IS:"<< netpay<< endl;

}
input.close();
system("pause");
return 0;
}


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>