Programming Assignment: Payroll Write a C++ program that calculates the weekly payroll for five employees. Your program should ask the user to enter the following data for each employee: • Employee ID • Hours worked • Hourly pay rate Your program should then calculate the gross pay for each employee and display the following output to the screen: • Employee ID • Hours worked • Hourly pay rate • Gross pay Arrays and Global Constants Your program should contain four arrays and two global constants which are described in the following table: Name Description NUMBER_OF_EMPLOYEES Global constant. Value equals 5. EMPLOYEE_ID_LENGTH Global constant. Value equals 4. employeeID String array. Size equals NUMBER_OF_EMPLOYEES. hoursWorked Double array. Size equals NUMBER_OF_EMPLOYEES. payRate Double array. Size equals NUMBER_OF_EMPLOYEES. grossPay Double array. Size equals NUMBER_OF_EMPLOYEES. Input Validation Your program should ensure valid user input as follows: Variable Validation Rule employeeID Length must be exactly four characters long; can be any combination of letters or numbers. Check the length using employeeID[count].length() hoursWorked Cannot be less than zero. payRate Must be greater than zero. Functions Your program should contain a total of four functions including the main function. All functions except the main function are described in the following table: 2 Function Name Description Returns getData Reads the employee ID, hours worked, and pay rate for each employee and stores each value in the appropriate array. All arrays must be passed to this function and this function must be able to change the contents of each array. void calculateGrossPay Calculates the gross pay for each employee and stores the result in the grossPay array. The three arrays, hoursWorked, payRate, and grossPay must be passed to this function. Do not allow this function to change the values of the hoursWorked array and the payRate array. void displayOutput Displays the payroll results. The four arrays, employeeID, hoursWorked, payRate, and grossPay must be passed to this function. Do not allow this function to change the values of these arrays. void Output A screenshot of a sample run for this program is shown below. Design your program so it looks exactly like the one shown in the screenshot. Use two fixed-point decimal places for all numerical output. Align all output as shown in the screen shot.
T CAUsersCraig\Documents\MGCCC1# C++ (ONLINE) #Chapterå…¥Programming Assignments\Payr Enter the following data for employee 1: Employee ID: 0458 worked: 35.8 Pay rate (per hour): 23.45 Enter the following data for employee 2: Employee ID: 1358 worked: 34.5 Pay rate (per hour): 19.5 Enter the following data for employee 3: Employee ID: 3544 worked: 30.5 Pay rate (per hour): 20.75 Enter the following data for employee 4: Employee ID: 9965 worked: 39.4 Pay rate (per hour): 26.75 Enter the following data for employee 5: Employee ID: 9930 worked: 40 Pay rate (per hour): 34.5 Weekly Payroll Emloyee ID HourS WOorked Pay Rate Gross Pay 0458 1358 3544 9965 9930 35.80 34.50 30.50 39.40 40.00 23.45 19.50 20.75 26.75 34.50 839.51 672.75 632.88 1053.95 1380.00 Process exited after 47.58 seconds with return ualue Press any key to continue