Question
Write a program that will allow the user to calculate the gross wages of several employees. There is a menu function that will print the
Write a program that will allow the user to calculate the gross wages of several employees.
There is a menu function that will print the possible choices the user may make in manipulating the data and a switch that will process the choice. It will incorporate a getdata function and arrays to allow the user to input employee data (name, id number, hours worked and hourly rate).
There is a function that will calculate the gross wages for each employee using the nested if else statements of an earlier program to deal with overtime issues. It will also calculate the total payroll for the week.
It will have a print function that will include a heading and will output the name, id number(with leading zeros) hours worked, hourly rate and gross wages in tabular form. It will also compute the weekly payroll.
An optional function would allow the user to edit an employees hours worked and hourly rate. It would then recalculate the gross pay of the employee. You can access the employee record using either id number or name. Another optional function will allow the user to sort the employee records.
Menu Function:
Payroll Program
Please choose from the following
1. Input Employee Data
2. Compute Gross pay
3. Edit Employee Data
4. Sort Employee Records
5. Print Report
6. Exit
Function Prototypes: the functions must contain the following parameters. You may include addition parameters as required.
void GetData(string FullNamef[], int EmployeeNumberf[], float HoursWorkedf[], float HourlyRatef[], int &Indexf);
void ComputePay(float HoursWorkedf[], float HourlyRatef[], float TotalPayf[],float &TotalPayrollf, int Indexf);
void PrintResults(string FullNamef[], int EmployeeNumberf[], float HoursWorkedf[], float HourlyRatef[], float TotalPayf[],float TotalPayrollf, int Indexf);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started