I need help with this

Im trying to compute the base pay, overtime pay ad gross pay
[code]
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
int hoursWorked;
double hourlyRate, grossPay;

cout << "Enter the hourly rate of pay; $";
cin >> hourlyRate;
cout << "Enter the number of hours worked, " <<endl;
cout << "rounded to a whole number of hours:";
cin >> hoursWorked;

grossPay = hourlyRate * hoursWorked;//calculate gross pay

cout << fixed << setprecision(2);

cout << "Hours worked = " << hoursWorked << endl;
cout << "Hourly pay rate = $" << hourlyRate << endl;
cout << "Gross pay = $" << grossPay << endl;

return 0;
[/code}

Last edited on
Please edit your post you made and use proper code formatting. This means putting [code] and [/code] around your code.

That isn't your full, verbatim code. You left out a closing }. Also, if( (hoursWorked - 40) > = 4), > = is not an operator, it must be >= without spaces.
eles is not a keyword, you mean else... proofread :)
Damn, Gandhi came back among us to code :3
Once you get the code to compile and run, check your algorithm. You're computing and printing the base pay OR the overtime pay, but not both.
Topic archived. No new replies allowed.