You are on page 1of 1

#include <iostream>

#include <iomanip>

using namespace std;

int main()
{
double hours, hourlyrate;
double grosspay, taxes, netpay, taxamount;
string percentage;

cout << "enter hours: " << endl;


cin >> hours;

cout << "enter hourly rate: " << endl;


cin >> hourlyrate;

grosspay = hour * hourlyrate;

if (grosspay >= 400)


{
taxes = 0.20;
percentage = "20%";
}
else if (grosspay >= 200)
{
taxes = 0.15;
percentage = "15%"}
{
else if (grosspay > 0)
{
taxes = 0.10;
percentage = "10%";
}
else if (grosspay <= 0)
{
cout << "one or either number provided is incorrect. \endl";
cout << "plese re-enter",
}

netpay = grosspay * (1 - taxes);


taxamount = grosspay * taxes;

cout << fixed << showpoint;

cout << setprecision(2) << "gross pay: $ " << setw(6) << grosspay << endl;
cout << setprecision(2) << "taxes: " << setw(6) << taxamount <<
setw(5) << "(" << percentage << ")" << endl;
cout << setw(20) << "------";
cout << setprecision(2) << "net pay: $ " << setw(6) << netpay << endl;

return 0;
}

You might also like