Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

What the input looks like:

image text in transcribed

Output should look something similar to this:

image text in transcribed

struct Employee string name vector

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

How would we like to see ourselves?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago