Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. const double FEDERAL_TAX_RATE = 0.15;
  5. const double STATE_TAX_RATE = 0.035;
  6. const double SOCIAL_SECURITY_TAX_RATE = 0.0575;
  7. const double MEDICARE_MEDICATE_TAX_RATE = 0.0275;
  8. const double PENSION_PLAN_RATE = 0.05;
  9. const double HEALTH_INSURANCE = 75.00;
  10. int main()
  11. {
  12. double grossPay, netPay;
  13. cout << "Please enter amount paid:";
  14. cin >> grossPay;
  15. double fT=(grossPay*FEDERAL_TAX_RATE), sT=(grossPay*STATE_TAX_RATE), ssT=(grossPay*SOCIAL_SECURITY_TAX_RATE);
  16. double mT=grossPay*MEDICARE_MEDICATE_TAX_RATE, pP=(grossPay*PENSION_PLAN_RATE), hI = 75.00;
  17. netPay = grossPay-fT-sT-ssT-mT-pP-hI;
  18. cout<< left <<  setw(26) << "Gross Amount: "
  19.      << right << " $"
  20.   << setw(7) << grossPay << endl;
  21. cout<< left <<  setw(26) << "Federal Tax: "
  22.      << right << " $"
  23.   << setw(7) << fT << endl;
  24. cout<< left <<  setw(26) << "State Tax: "
  25.      << right << " $"
  26.   << setw(7) << sT << endl;
  27. cout<< left <<  setw(26) << "Social Security Tax: "
  28.      << right << " $"
  29.   << setw(7) << ssT << endl;
  30. cout<< left <<  setw(26) << "Medicare Tax: "
  31.      << right << " $"
  32.   << setw(7) << mT << endl;
  33. cout<< left <<  setw(26) << "Pension Plan: "
  34.      << right << " $"
  35.   << setw(7) << pP << endl;
  36. cout<< left <<  setw(26) << "Health Insurance: "
  37.      << right << " $"
  38.   << setw(1) << hI << endl;
  39. cout<< left <<  setw(26) << "Net Pay: "
  40.      << right << " $"
  41.   << setw(7) << netPay << endl;
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement