Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this assignment, write a program that will act as a wage calculator for a si

ID: 3542054 • Letter: F

Question

For this assignment, write a program that will act as a wage calculator for a single user.

The program should prompt the user to enter the number of hours that they worked and their hourly wage. Those values will then be used to calculate:

The Gross Pay is based upon the number of hours that were worked. If the user worked 40 hours or less, then:

If the user worked more than 40 hours, then:

The Amount of Deductions is based up the gross pay. If the user earned $100.00 or less, the deductions are 2% of the gross pay. If the user earned between $100.01 and $500.00, inclusive, the deductions are 5% of the gross pay. If the user earned more than $500.00, the deductions are 9% of the gross pay.

The Net Pay is based upon the gross pay and the deductions.

After all of the values have been calculated, display a simple table that contains: the number of hours worked, hourly wage, gross pay, amount of deductions, and net pay.

and this was the program used for it which works fine.


#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int hours_worked;
double gross_pay,deductions,net_pay;
double hourly_wage = 24;
cout << "Enter the number of hours worked :";
cin >>hours_worked;
cout << endl;
cout << "Enter hourly wage :";
cin >>hourly_wage;
cout << endl;
if(hours_worked<40)
gross_pay = hours_worked *hourly_wage;
else if(hours_worked>40)
gross_pay = 40 *hourly_wage + (hours_worked-40)*hourly_wage*1.5;

if(gross_pay <=100)
deductions = 0.02*gross_pay;
else if(gross_pay>=100 && gross_pay<=500)
deductions = 0.05*gross_pay;
else
deductions = 0.09*gross_pay;
net_pay =gross_pay- deductions;
cout <<"total number of hours worked is " << fixed << setprecision(2) << hours_worked << endl;
cout <<"hourly wage is " << fixed << setprecision(2) << hourly_wage << endl;
cout <<"gross pay is " << fixed << setprecision(2) << gross_pay << endl;
cout <<"amount of deductions are " <<fixed << setprecision(2) << deductions << endl;
cout <<"net pay is " << fixed << setprecision(2) << net_pay << endl;
return 0;
}


now i must.

For this assignment, modify program 2 so that it will calculate the wages for multiple employees rather than just a single employee.

The program works in essentially the same manner as program 2. The things that should be added for this program are:

A loop that will execute at least one time. This loop should continue to execute as long as there are employees. This will be indicated when the user of the program is asked if there are more employees and they answer 'y' (character value) for "yes". Inside of this loop is where the prompts, calculations, and display of the calculated results from program 2 should be placed.

The program should also calculate the total number of employees that are being processed, total gross pay, total deduction amount, and total net pay. These values should all be displayed after the user indicates that there are no more employees.

This i am having a ton of trouble with even though the majority of the work is already done.

Explanation / Answer

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int hours_worked;
double gross_pay,deductions,net_pay;
double total_gross_pay=0,total_deductions=0,total_net_pay=0;
double hourly_wage = 24;
int total_emp_count=0;
char response = 'y';
do
{
cout << "Enter the number of hours worked :";
cin >>hours_worked;
cout << endl;
cout << "Enter hourly wage :";
cin >>hourly_wage;
cout << endl;
if(hours_worked<40)
gross_pay = hours_worked *hourly_wage;
else if(hours_worked>40)
gross_pay = 40 *hourly_wage + (hours_worked-40)*hourly_wage*1.5;
if(gross_pay <=100)
deductions = 0.02*gross_pay;
else if(gross_pay>=100 && gross_pay<=500)
deductions = 0.05*gross_pay;
else
deductions = 0.09*gross_pay;
net_pay =gross_pay- deductions;
cout <<"total number of hours worked is " << fixed << setprecision(2) << hours_worked << endl;
cout <<"hourly wage is " << fixed << setprecision(2) << hourly_wage << endl;
cout <<"gross pay is " << fixed << setprecision(2) << gross_pay << endl;
cout <<"amount of deductions are " <<fixed << setprecision(2) << deductions << endl;
cout <<"net pay is " << fixed << setprecision(2) << net_pay << endl;
total_emp_count++;
total_gross_pay = total_gross_pay + gross_pay;
total_deductions = total_deductions + deductions;
total_net_pay = total_net_pay + net_pay;
cout <<"Do you have more employees (enter y or n)";
cin >> response;
}while(response=='y' || response=='Y');
cout << endl;
cout <<"total number of emplyees are " << total_emp_count<< endl;
cout <<"total gross pay is " << fixed << setprecision(2) << total_gross_pay << endl;
cout <<"total amount of deductions are " <<fixed << setprecision(2) << total_deductions << endl;
cout <<"total net pay is " << fixed << setprecision(2) << total_net_pay << endl;

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote