Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- const double FEDEARL_TAX_RATE = 0.15;
- const double STATE_TAX_RATE = 0.035;
- const double SOCIAL_SECURITY_TAX_RATE = 0.0575;
- const double MEDICARE_MEDICATE_TAX_RATE = 0.0275;
- const double PENSION_PLAN_RATE = 0.05;
- const double HEALTH_INSURANCE = 75.00;
- int main()
- { //Declare variables
- double rawAmount, grossAmount, fedTaxRate, stateTaxRate, socSecTax, medMedTax, penPlanRate, healthInsurance;
- // Grab raw amount from user
- cout << "Input the raw amount you made: $";
- cin >> rawAmount;
- cout << endl;
- // Calculate gross amount, federate tax, sale tax, social security, medicare/medicaid tax, pension plan, health insurance and net pay
- fedTaxRate = (FEDEARL_TAX_RATE*rawAmount);
- stateTaxRate = (STATE_TAX_RATE*rawAmount);
- socSecTax = (SOCIAL_SECURITY_TAX_RATE*rawAmount);
- medMedTax = (MEDICARE_MEDICATE_TAX_RATE*rawAmount);
- penPlanRate = (PENSION_PLAN_RATE*rawAmount);
- healthInsurance = penPlanRate - HEALTH_INSURANCE;
- grossAmount = rawAmount - fedTaxRate - stateTaxRate - socSecTax - medMedTax - penPlanRate - healthInsurance;
- //Display output
- cout<< left << setw(26) << "Federal Tax Rate: "
- << right << " $"
- << setw(7) << fedTaxRate << endl;
- cout<< left << setw(26) << "State Tax: "
- << right << " $"
- << setw(7) << stateTaxRate << endl;
- cout<< left << setw(26) << "Social Security Tax: "
- << right << " $"
- << setw(7) << socSecTax << endl;
- cout<< left << setw(26) << "Medicare Medicate Tax: "
- << right << " $"
- << setw(7) << medMedTax << endl;
- cout<< left << setw(26) << "Pension Plan Rate: "
- << right << " $"
- << setw(7) << penPlanRate << endl;
- cout<< left << setw(26) << "State Tax: "
- << right << " $"
- << setw(7) << HEALTH_INSURANCE << endl;
- cout<< left << setw(26) << "Gross Amount: "
- << right << " $"
- << setw(7) << grossAmount << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement