Advertisement
okelikai

Untitled

Sep 28th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5.  
  6. const double FEDEARL_TAX_RATE = 0.15;
  7. const double STATE_TAX_RATE = 0.035;
  8. const double SOCIAL_SECURITY_TAX_RATE = 0.0575;
  9. const double MEDICARE_MEDICATE_TAX_RATE = 0.0275;
  10. const double PENSION_PLAN_RATE = 0.05;
  11. const double HEALTH_INSURANCE = 75.00;
  12.  
  13. int main()
  14. { //Declare variables
  15.     double rawAmount, grossAmount, fedTaxRate, stateTaxRate, socSecTax, medMedTax, penPlanRate, healthInsurance;
  16. // Grab raw amount from user
  17.     cout << "Input the raw amount you made: $";
  18.     cin  >> rawAmount;
  19.     cout << endl;
  20. // Calculate gross amount, federate tax, sale tax, social security, medicare/medicaid tax, pension plan, health insurance and net pay
  21.     fedTaxRate = (FEDEARL_TAX_RATE*rawAmount);
  22.     stateTaxRate = (STATE_TAX_RATE*rawAmount);
  23.     socSecTax = (SOCIAL_SECURITY_TAX_RATE*rawAmount);
  24.     medMedTax = (MEDICARE_MEDICATE_TAX_RATE*rawAmount);
  25.     penPlanRate = (PENSION_PLAN_RATE*rawAmount);
  26.     healthInsurance = penPlanRate - HEALTH_INSURANCE;
  27.     grossAmount = rawAmount - fedTaxRate - stateTaxRate - socSecTax - medMedTax - penPlanRate - healthInsurance;
  28. //Display output
  29.     cout<< left <<  setw(26) << "Federal Tax Rate: "
  30.       << right << " $"
  31.    << setw(7) << fedTaxRate << endl;
  32.     cout<< left <<  setw(26) << "State Tax: "
  33.       << right << " $"
  34.    << setw(7) << stateTaxRate << endl;
  35.     cout<< left <<  setw(26) << "Social Security Tax: "
  36.       << right << " $"
  37.    << setw(7) << socSecTax << endl;
  38.    cout<< left <<  setw(26) << "Medicare Medicate Tax: "
  39.       << right << " $"
  40.    << setw(7) << medMedTax << endl;
  41.    cout<< left <<  setw(26) << "Pension Plan Rate: "
  42.       << right << " $"
  43.    << setw(7) << penPlanRate << endl;
  44.       cout<< left <<  setw(26) << "State Tax: "
  45.       << right << " $"
  46.    << setw(7) << HEALTH_INSURANCE << endl;
  47.     cout<< left <<  setw(26) << "Gross Amount: "
  48.       << right << " $"
  49.    << setw(7) << grossAmount << endl;
  50.  return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement