Answer to Question #301111 in C++ for Jasper

Question #301111

write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions:





Federal Income Tax: 15%



State Tax: 3.5%



Social Security Tax: 5.75%



Medicare/Medicaid Tax: 2.75%



Pension Plan: 5%



Health Insurance: $75.00

1
Expert's answer
2022-02-22T06:44:39-0500
#include <iostream>


#define FEDERAL_INCOME_TAX (15/100.0)
#define STATE_TAX (3.5/100.0)
#define SOCIAL_SECURITY_TAX (5.75/100.0)
#define MEDICAID_TAX (2.75/100.0)
#define PENSION_PLAN (5.0/100.0)
#define HEALTH_INSURANCE (75.0)


int main()
{
    double payment=0;
    std::cout << "Enter value : ";
    std::cin >> payment;
    double federal_tax = payment * FEDERAL_INCOME_TAX;
    double state_tax = payment * STATE_TAX;
    double social_tax = payment * SOCIAL_SECURITY_TAX;
    double medi_tax = payment * MEDICAID_TAX;
    double pension_tax = payment * PENSION_PLAN;
    double health_tax = HEALTH_INSURANCE;


    std::cout
        << "Federal Income Tax: " << federal_tax << std::endl
        << "State Tax: " << state_tax << std::endl
        << "Social Security Tax: " << state_tax << std::endl
        << "Medicare/Medicaid Tax: " << state_tax << std::endl
        << "Pension Plan: " << state_tax << std::endl
        << "Health Insurance: " << health_tax << std::endl;
    double final_payment = payment - federal_tax - state_tax - social_tax - medi_tax - pension_tax - health_tax;
    std::cout << "Final payment : " << final_payment << std::endl;


      
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog