Page 1 of 1

Assignment: Compute Employee Pay using arrays and pointers (Make the changes in your Assignment 5 so that arrays are tra

Posted: Tue Jul 12, 2022 8:20 am
by answerhappygod
Assignment: Compute Employee Pay using arrays and pointers (Makethe changes in your Assignment 5 so that arrays are transferred tothe functions as pointer variable parameters and the items of thearrays are accessed using pointer variables inside the functions.)(See the sample program - Pr7-12 Modified with Functions usingPointers) (It will worth ZERO, if pointers are not used in yourprogram as stated above) Write a program in C++ that will computeemployee’s overtime hours worked and the weekly pay. Given are theemployee’s name, the hours worked during the week and hourly rate.Your program will also find out the highest pay and the averageovertime hours of the employees. You were asked to use five arraysto store employee name (empName), hours worked (hour), hourly rate(rate), overtime hour (otHour), and pay (pay).
MUST use function prototypes so the functions are placed afterthe function main(). Without the use of function prototypes,assignment will not be graded and it will worth ZERO.
There are 3 employees, so you will use a constant NUM_EMPSequals to 3.
Declare this constant: const int NUM_EMPS = 3; // Number ofemployees
Array specifications. Declare these five arrays: empName -employee name - type string hour - number of hours worked in a week- type int rate - hourly pay rate - type double otHour - overtimehours - type int pay - weekly pay - type double
Use the following functions: 1. This function will get data forthe arrays empName, hour, and rate from the user interactively.getData (empName, hour, rate, NUM_EMPS); 2. This function willcompute over time hours and pay. calculate (hour, rate, otHour,pay, NUM_EMPS); 3. This function will find out the highest payearned. high = findHigh (pay, NUM_ EMPS); 4. This function willcalculate the average of all the overtime hours worked by theemployees. The variable average is declared as data type typedouble. averageOThour = findAverage (otHour, NUM_ EMPS); 5. Thisfunction will display the table as shown below, the average pay andthe highest pay. Display (empName, hour, otHour, rate, pay,average, high, NUM_EMPS);