Question

In: Computer Science

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.

Solutions

Expert Solution

Program:

//header file

#include

using namespace std;

//main function

int main()

{

//variable data type declrations

double earnings, gross_pay, net_pay;

int n_dependent;

//ask to input data

cout<<"Enter the Employee Earning: ";

cin>>earnings;

cout<<"Enter the number of dependents: ";

cin>>n_dependent;

//if number of depenedent <=3 and earnings is > 1000
if(n_dependent <=3 && earnings > 1000)

{

//calculate gross pay

gross_pay = earnings - 150;

//calculate earnings

earnings = earnings - 1000;

//calculate net_pay

net_pay = earnings - (earnings * 15.5)/100 - 150;

}

//if number of depenedent >3 and earnings is > 1000

else if(n_dependent > 3 && earnings > 1000)

{

//calculate gross pay


gross_pay = earnings - 150;

//calculate taxable earnings

earnings = earnings - 1000;

//calculate net pay

net_pay = earnings - (earnings * 12.5)/100 - 150;

}

//if earning is less than 1000

else

{

gross_pay = earnings;

net_pay = earnings;

}

//display the gross pay and netpay

cout<<"Gross Pay is: "<

cout<<"NetPay is: "<

return 0;

}//end of the program


------------------------------------------------------------------------------------------------------------------------------------------

here i have attached various sample run in a single screen shot. You can also try and execute the program with different data.

Output:


Related Solutions

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...
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,...
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:...
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...
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...
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...
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 42 hours (42 - 40 were overtime hours) during a workweek in December of 2017. He earns $40.50/hour, with his employer paying 1.5 times the regular rate of pay for overtime...
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 45 hours (45 - 40 were overtime hours) during a workweek in October of 2017. The employee earns $45/hour, with his employer paying 1.5 times the regular rate of pay for...
Examine your last pay check. Determine the percentage of your gross pay that is taken for...
Examine your last pay check. Determine the percentage of your gross pay that is taken for deductions (including taxes, social security, health care, retirement, etc.). Total these deductions and then divide by your gross pay to determine the percentage. You do not have to disclose the amount of your gross pay or your deductions, but you may share the percentage of your pay that went for these deductions. Does this surprise you? Are there things you could change about this?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT