I really appreciate your help and here is the code that I have now
Code:
#include <fstream> //Allows you to read and write data to and from files.
#include <iostream> //Needed for cin, cout.
#include <stdlib.h> //Needed for system().
#include <iomanip> //Needed to control printing.
using namespace std;
int main()
{
int empNum;
double overTime,
overTimePay,
grossPay,
rate,
hoursWorked,
overTimeHours,
overTimeThreshold = 40.00;
cout << "Employee No.\t";
cout << "Pay Rate\t";
cout << "Hours\t";
cout << "O/T Hours\t";
cout << "Gross Pay\t";
ifstream project2;
project2.open("project2.dat");
project2>>overTime;
project2>>empNum;
while(project2){
project2>>empNum;
project2>>rate;
project2>>hoursWorked;
if(hoursWorked <= overTimeThreshold){
overTimeHours = 0.00;
grossPay = (hoursWorked * rate);
}
else{
overTimeHours = hoursWorked - overTimeThreshold;
grossPay = (overTimeThreshold* rate)+ (1.5(hoursWorked - overTimeThreshold));
}
project2>>empNum;
}
return 0;
}
the compiler is still picking up an error in the last else statement and i can't find it, so it won't compile the .exe file for me.