Question: Hello please help me write this code using follow instructions: IN C++ Write a program, which accepts name and number of hours worked per week

Hello please help me write this code using follow instructions:IN C++

Write a program, which accepts name and number of hours worked per week of an employee and computes weekly salary of the employee. The program, also, calculates income tax (15%) and net wage of the employee. The rate per hour over 40 is one and half times the normal rate ($10/hour). The program will display the highest and lowest salary holders record.

Five functions can be used

read_data, compute_salary, find_max, find_min, show_result.

read_data will accept name and hours worked

compute_salary computes weekly salary, income tax paid, and net wage;

show_result will display name, hours, salary, tax paid, and net wage of the employee in a table.

The program will use a data file as shown below:

Ronnie Zamora 45

Andy Smith 35

Nancy Lopez 25

Rudy Miller 15

Abel Gonzalez 20

John Doe 42

Mary Doe 18

The functions are the following:

read_data()

This function will read name and hours from data file and bring them back to the main program (function must have two parameters name as string, and hours as float. Both parameters must be call by reference type. )

compute_salary()

This function will use hours and rates to calculate salary, tax paid, and net pay. So the function must have four parameters hours, salary, tax_paid, and net_pay. Among these parameters hours should be call by value type and the rest of them are call by reference type.

show_result()

This function will display name, hours, salary, tax_paid, and net_pay. All these parameters are call by value type.

find_max()

This function will use net_pay to find maximum salary holder's record (name, and net_pay). The function must have four parameters, name, net_pay, max_name, max_pay.

The first two are call by value, and the last two are call by reference.

find_min()

This function will use net_pay to find minimum salary holder's record (name and net_pay). The function must have four parameters, name, net_pay, min_name, min_pay. The first two are call by value, and the last two are call by reference.

This is how the output should look like (SEPARATED I DONT KNOW WHY IT DIDNT LET ME PUT IT LIKE IT SHOULD)

NAME HOURS SALARY TAX NET PAY

Ronnie Zamora 45.00 475.00 71.25 403.75

Andy Smith 35.00 350.00 52.50 297.50

Nancy Lopez 25.00 250.000 37.50 212.50

Rudy Miller 15.00 150.00 22.50 127.50

Abel Gonzalez 20.00 200.00 30.00 170.00

John Doe 42.00 430.00 64.00 365.50

Mary Doe 18.00 180.00 27.00 153.00

Ronnie Zamora is holding the largest salary of 403.75

Rudy Miller is holding the lowest salary of 127.50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!