#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
string last, first;
float hours, payrate, overtimerate, regpay, overtimepay, fedtax, statetax, id,
reghours, overtimehours;
cout << "1. Enter the employee's LAST Name ";
cin >> last;
cout << "2. Enter the employee's FIRST Name ";
cin >> first;
system("cls");
cout << "3. Enter the employee's ID Number ";
cin >> id;
system("cls");
cout << "4. Enter the employee's Total Hours Worked up to a maximum of 60 hours ";
cin >> hours;
system("cls");
cout << "5. Enter the employee's regular Pay Per Hour ";
cin >> payrate;
overtimerate = (payrate * 1.5);
system("cls");
if (hours > 60)
hours = 60;
if (hours <= 40)
reghours = hours;
if (hours <= 60) && (hours > 40)
overtimehours = (hours - 40);
regpay = (reghours * payrate);
overtimepay = (overtimehours * overtimerate);
cout << "\n\nHit ANY key to continue...";
return 0;
}
This is what I have so far and it keeps giving me an error. I can't for the life of me figure out what the problem is.
This if (hours <= 60) && (hours > 40)
is wrong. It must be if ((hours <= 60) && (hours > 40)) // Note the extra parentheses
I can't believe that was the only problem. Thanks so much !