im trying to develope a program that determines gross pay not including overtime. Pay rate must be between $1-$100
The tax rates are as follows:
>= 2500.00 then Tax Rate equals 0.45
>= 2000.00 then Tax Rate equals 0.40
>= 1500.00 then Tax Rate equals 0.35
>= 1000.00 then Tax Rate equals 0.30
Less than 1000.00 has a Tax Rate equal to 0.25
the input screen should look like this
Enter the following data:
Hours Worked: (Number)
Hourly Rate: (Number)
the output screen should look like this
Hours Worked : (number)
Hourly Rate: (number)
Tax Rate: (number)
Gross Pay: (number)
Taxes: (number)
Net Pay: (number)
code:
#include <iostream>
using namespace std;
int main()
{
double x,y,taxrate,grosspay,tax,netpay
A couple things:
1. You are missing a lot of ; at the end of your lines.
2. I don't think you need the while loop.
3. The syntax forif (2000<grosspay>=2500) is if (2000 <= grosspay && grosspay < 2500) , I change the boundaries to match what you said above. Check the other tax rates.
4. Look at you if () else if () structure.
5. Syntax for cout of a variable is cout << "Hours worked: " << x << endl;, not return.
Hope this helps