Question: Using file I / O , arrays and functions Program Description: In this program you will need to read from a file employee data for
Usingfile IO arrays and functions
Program Description:In this program you will need to read from a file employee data for how many hours each employee worked for a week. Then for each of the employees, calculate the total of the hours worked and then sort the employees and their data into descending order based on their total hours.
Task Details:
Create a x int array to hold the employees data, and a size string array to hold the employee names.
Read all the employee data into the arrays
Total number of hours worked in the week and store it in the int array at location Create a const variable to make it obvious that your th position is being used to hold the total hours worked. Example: hour i TTLHRS total;
Sort theemployees by the total number of hours they worked for the week. The sort should be in descending order most hours to least
Write out the information to the console
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
