Question: You are asked to write a program that will compute the total pay of each employee and the total payroll amount of the company. The
You are asked to write a program that will compute the total pay of each employee and the total payroll amount of the company. The data of the employees will be stored in an array of structure employee There are 5 employees and NUM_EMPS is defined as a constant. The element of the array-employee has the following members: struct incomeInfo {
string emp_id;
double pay;
double bonus;
double totPay;
};
incomeInfo employee[NUM_EMPS]; //array declaration To compute the total pay of each employee there are two components - pay and bonus. You add the pay and bonus amount to compute the total pay. Use the following procedure and function calls: //This function enters id, pay, and bonus of each employee
getIncome (employee, NUM_EMPS); //This function computes the total pay of each employee
compute (employee, NUM_EMPS); //This function computes the total payroll of the company
Total = payroll (employee, NUM_EMPS); //This function displays the detail lines of each employee Id, Pay, Bonus, and Total Pay and the total payroll of the company
display (employee, total, NUM_EMPS); Use this data for testing: ID Pay Bonus 123 5000.00 500.25
133 4000.00 0.00
167 3500.75 100.00
156 6200.50 0.00
195 2000.00 300.00 Sample output display: (The amounts in Pay, Bonus, and Total Pay column will line up to the right therefore the decimal points are lined up.- 1 point) All the dollar amounts will be rounded to two digits after decimal point. ID Pay Bonus Total Pay 123 5000.00 500.25 5500.25 133 4000.00 0.00 4000.00 167 3500.75 100.00 3600.75 156 6200.50 0.00 6200.50 195 2000.00 300.00 2300.00 Total Payroll amount
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
