Ask Question
11 January, 07:23

An employee is paid at rate of 16.78$ per hour for the first 40 hours worked in a week. Any hours over that are paid at the overtime rate of one and one half times that. From the worker's gross pay, 6% is witheld for social security tax, 14% is witheld for federal income tax, 5% is witheld for state income tax, and 10 dollars per week is witheld for union dues. If the worker has three or more dependents, then the additional 35 dollars is withheld to cover the extra cost of helf insurance beyond what the employer pays. Write the program that will read in the number of hours worked in a week and the number of dependents as input, and will then output the worker's gross pay, each witholding amount, and the net take home pay for the week. For the harder version, write your program so that it allows the calculation to be repeated as often as the user wishes.

+2
Answers (1)
  1. 11 January, 09:04
    0
    1. Number of regular working hours

    2. Number of overtime working hours

    3. Numbers of dependents.

    Explanation:

    Program:

    #include

    using namespace std;

    int main ()

    {

    float x1, x2, x, s, f, i, t;

    int d, d1;

    cout << "Enter number of regular working hours " << endl;

    cin >> x1;

    cout << "Enter number of overtime working hours " << endl;

    cin >> x2;

    cout << "Enter number of dependents " << endl;

    cin >> d;

    x1=16.78*x1;

    x2=25.17*x2;

    x=x1+x2;

    cout << "Workers Gross pay : $"<
    s = (6*x) / 100;

    f = (14*x) / 100;

    i = (5*x) / 100;

    d1=0;

    if (d>=3)

    d1=35;

    t=x-s-f-i-d1-10;

    cout << "Social Security Tax : $"<
    cout << "Federal Income Tax : $"<
    cout << "State Income Tax : $"<
    cout << "Union Dues : $10"<< endl;

    cout << "Extra cost of health Insurance : $"<
    cout << "Net Take Home : $"<
    return 0;

    }

    Output:

    Test case 1:

    Enter number of regular working hours 20

    Enter number of overtime working hours 0

    Enter number of dependents 2

    Workers Gross pay: $335.6

    Social Security Tax : $20.136

    Federal Income Tax : $46.984

    State Income Tax : $20.136

    Union Dues : $10

    Extra cost of health Insurance : $0

    Net Take Home : $241.7

    Test case 2

    Enter number of regular working hours 10

    Enter number of overtime working hours 5

    Enter number of dependents 3

    Workers Gross pay : $293.65

    Social Security Tax : $17.619

    Federal Income Tax : $41.111

    State Income Tax : $17.619

    Union Dues : $10

    Extra cost of health Insurance : $35

    Net Take Home : $175.238
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “An employee is paid at rate of 16.78$ per hour for the first 40 hours worked in a week. Any hours over that are paid at the overtime rate ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers