Question: Write a C++ program that will need to read from a file of employee data for how many hours each employee worked for a week.

Write a C++ program that will need to read from a file of employee data for how many hours each employee worked for a week. Then for each of the employees, a total of the hours worked is made and then the employees are sorted into descending order based on their total hours using bubble sort. Also needs to use structures and vectors.

There needs to be 3 function calls in main that:

-Open and read the file into the vectors and add the total hours worked for each employee

-Sort the vector based on the total hours

-Write out the output

(the functions have to be defined after main and need function prototypes before main)

What the structure has to look like:

Write a C++ program that will need to read from a file

What the input looks like:

of employee data for how many hours each employee worked for a

Output should look something similar to this:

week. Then for each of the employees, a total of the hours

struct Employee string name vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!