Question

In: Computer Science

Develop a C++ program that will determine the gross pay and net pay (after taxes). Each...

Develop a C++ program that will determine the gross pay and net pay (after taxes). Each employee pays a flat tax of 150.00 on the first 1000.00 dollars earned. If the employee earns less than 1000.00 dollars then he/she pays no taxes. Taxes are computed at 15.5% on all earnings over 1000.00 dollars if the number of dependents is 3 or less and 12.5% if the number of dependents are 4 or more.

Sample input/outpt dialog

Enter # of yours worked: 99.99

Enter rate of pay: 10.00

Enter number of dependents: 2

Results

Gross salary is: $9999.99

Taxes withheld: $99.99

Salary after taxes: $999.99

Solutions

Expert Solution

C++ Program:

#include <iostream>
#include <iomanip>

using namespace std;

//Main function
int main()
{
    int hoursWorked, dependents;
    double payRate, grossPay, taxes, netPay;

    //Reading number of hours worked
    cout << "\n Enter # of hours worked: ";
    cin >> hoursWorked;

    //Reading pay rate
    cout << "\n Enter rate of pay: ";
    cin >> payRate;

    //Reading number of dependents
    cout << "\n Enter number of dependents: ";
    cin >> dependents;

    //Calculating gross pay
    grossPay = hoursWorked * payRate;

    //If gross pay is less than 1000 dollars
    if(grossPay < 1000)
    {
        taxes = 0;
    }
    else
    {
        //Tax for first 1000 dollars
        taxes = 150.00;

        //Calculating taxes depending on number of dependents
        if(dependents <= 3)
        {
            //Tax rate @15.5 %
            taxes = taxes + ( (grossPay - 1000) * 0.155 );
        }
        else
        {
            //Tax rate @12.5 %
            taxes = taxes + ( (grossPay - 1000) * 0.125 );
        }
    }

    //Calculating net pay
    netPay = grossPay - taxes;

    //For two decimal places
    cout << fixed << setprecision(2);

    //Printing results
    cout << "\n\n Gross Salary is: $" << grossPay;
    cout << "\n\n Taxes withheld: $" << taxes;
    cout << "\n\n Salary after taxes: $" << netPay;

    cout << "\n\n";
    return 0;
}


______________________________________________________________________________________________

Sample Output:


Related Solutions

Develop a C++ program that will determine the gross pay and netpay (after taxes). Each...
Develop a C++ program that will determine the gross pay and net pay (after taxes). Each employee pays a flat tax of 150.00 on the first 1000.00 dollars earned. If the employee earns less than 1000.00 dollars then he/she pays no taxes. Taxes are computed at 15.5% on all earnings over 1000.00 dollars if the number of dependents is 3 or less and 12.5% if the number of dependents are 4 or more.
In C Program #include Create a C program that calculates the gross and net pay given...
In C Program #include Create a C program that calculates the gross and net pay given a user-specified number of hours worked, at minimum wage. The program should compile without any errors or warnings (e.g., syntax errors) The program should not contain logical errors such as subtracting values when you meant to add (e.g., logical errors) The program should not crash when running (e.g., runtime errors) When you run the program, the output should look like this: Hours per Week:...
Please use C++ program. uses a while statement to determine the gross pay for each of...
Please use C++ program. uses a while statement to determine the gross pay for each of several employees. When someone works 41 hours or more. They get paid 1.5x more so my problem is that in my else if statement. The C++should ask repeatedly if the user wants to continue: y or n, if the user types y, then the program should ask for the hours and rate for another employee then display the grosspay. When the user type n,...
my program should work for ANY NUMBER OF WORKERS..after all worker gross and net pay have...
my program should work for ANY NUMBER OF WORKERS..after all worker gross and net pay have been calculated, you should display the total number of workers, the total gross pay, and the total net pay. Employee ID Employee Name The number of hours worked The Employees hourly wage… i used while loop EmpName= input(str("PLease enter Employee name: or press -1 to exit: ")) while EmpName != "-1": EmpID= input("Enter Employee ID: ") how do i write this in a list...
Develop a Java application that determines the gross pay for each of three employees.
(Salary Calculator) Develop a Java application that determines the gross pay for each of three employees. The company pays straight time for the first 40 hours worked by each employee and time and a half for all hours worked in excess of 40. You’re given a list of the employees, their number of hours worked last week and their hourly rates. Your program should input this information for each employee, then determine and display the employee’s gross pay. Use class...
Compute the deductions, net pay, and accumulated gross earnings for each weekly pay period. Assume that...
Compute the deductions, net pay, and accumulated gross earnings for each weekly pay period. Assume that Joseph is single and that $28.25 was withheld for medical insurance (pre-tax) and $20 for his United Way contribution. Use the wage bracket method to determine federal income tax. Round answers to the nearest hundredth. Gross Earnings(650.95) Allow.(1) Fed. Inc. Tax Social Security (6.2%)Medicare (1.45%) Medical Insurance Pre-tax United Way Total Deductions Net Pay Accum. Gross Earnings ($1,558.90)
List some of the items that are deducted from gross pay to arrive at net pay...
List some of the items that are deducted from gross pay to arrive at net pay on an employee's paycheck. Discuss the different types of taxes. Which taxes are deducted from an employee's paycheck and which taxes are the employer responsible for paying?
For the payroll period ended on June 25, 2013, gross pay was $20,750, net pay was...
For the payroll period ended on June 25, 2013, gross pay was $20,750, net pay was $12,000, FICA tax withholdings were $3,500, income tax withholdings were $4,200, and medical insurance contributions were $1,050.
PSc 2-7 Calculate Gross Pay with Commissions Calculate gross pay for each of the following employees....
PSc 2-7 Calculate Gross Pay with Commissions Calculate gross pay for each of the following employees. All are paid an overtime wage rate that is 1.5 times their respective regular wage rates. NOTE: For simplicity, all calculations throughout this exercise, both intermediate and final, should be rounded to two decimal places at each calculation. 1: Dennis McDonald earns both $8.25/hour and a 11% commission on all sales. During the most recent week, he worked 44 hours and made total sales...
For each employee, first calculate gross pay. Then determine taxable income used to calculate federal income...
For each employee, first calculate gross pay. Then determine taxable income used to calculate federal income tax withholding, Social Security tax, and Medicare tax. NOTE: For simplicity, all calculations throughout this exercise, both intermediate and final, should be rounded to two decimal places at each calculation. 1:An employee works 47 hours (47 - 40 were overtime hours) during a workweek in December of 2017. He earns $39/hour, with his employer paying 1.5 times the regular rate of pay for overtime...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT