(Make the changes in your Assignment 5 so that arrays are transferred to the functions as pointer variable parameters and the items of the arrays are accessed using pointer variables inside the functions.) (See the sample program - Pr7-12 Modified with Functions using Pointers) (It will worth ZERO, if pointers are not used in your program as stated above) Write a program in C++ that will compute employee's overtime hours worked and the weekly pay. Given are the employee's name, the hours worked during the week and hourly rate. Your program will also find out the highest pay and the average overtime hours of the employees. You were asked to use five arrays to 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 after the 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_EMPS equals to 3. Declare this constant: const int NUM_EMPS = 3; // Number of employees Array specifications. Declare these five arrays:
Hours worked over 40 during the week is considered over time hours. Over time hours are paid one time and half (11/2) of the regular hourly pay. Your program will prompt the Employee name, hour, and rate. Input prompt messages: Employee Name Hours worked during week : : (After the data entry of each employee, clear the screen) Use the following functions: 1. This function will get data for the arrays empName, hour, and rate from the user interactively. getData (empName, hour, rate, NUM_EMPS); 2. This function will compute over time hours and pay. calculate (hour, rate, otHour, pay, NUM_EMPS); 3. This function will find out the highest pay earned. high = findHigh (pay, NUM_EMPS); 4. This function will calculate the average of all the overtime hours worked by the employees. The variable average is declared as data type type double. averageOThour = findAverage (otHour, NUM_EMPS); 5. This function will display the table as shown below, the average pay and the highest pay. Display (empName, hour, otHour, rate, pay, average, high, NUM_EMPS);
(Make the changes in your Assignment 5 so that arrays are transferred to the functions as pointer variable parameters an
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
(Make the changes in your Assignment 5 so that arrays are transferred to the functions as pointer variable parameters an
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!