Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. In the following program an employee of a company is represented by an object of type employee consisting of a name, employee id and

3. In the following program an employee of a company is represented by an object of type employee consisting of a name, employee id and employee salary. The class employee has methods read() and write().

Information about a companys workforce is stored in an object of type workforce consisting of the workforce size and a vector employees of that same size. The methods read() and write() are dened for workforce.

Do not modify the main program. Complete the program by writing the read and write methods for the class workforce. The constructor must create a vector of employees.

For marking purposes, use the input le workforcein.txt provided below

COPY/PASTE INTO TextEdit/Notes:

Smith 123 34000.00 Jones 189 38000.00 Black 342 45000.00 White 111 49000.00 Green 200 35000.00

THIS IS THE OUTPUT FILE SAMPLE: image text in transcribed

THIS IS THE CODE: image text in transcribed

image text in transcribed

. Workforce.n.txtEdited Smith 123 34000.00 Jones 189 38000.00 Black 342 45000.00 White 111 49000.00 Green 200 35000.00 Declaration of Employee and Workforce Classes File: workforce.h An employee 's information is stored as an object of type employee consisting of name, employee id and employee salary. The methods read) and write ) are defined for employee. Information about a company 's workforce is stored in an object of type workforce consisting of the workforce size and a vector of employees of that size The methods read) and write () are defined for workforce The read) and write ) methods for workforce use the read ) and write () methods for employee #ifn d e f #define WORKFORCE H WORKFORCE:H #include #include #include #include using namespace std; class employee private: string name; // last name int id /employee id number float salary; //employee salary public: employee (string n-"nobody", int i0, float s0) void read (istream & in); void write (ostream & out) const; class workforce private: int size; vector> name >> id >> salary; void employee: write (ostream & out) const out

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Prepare an M-1 reconciliation using the following data

Answered: 1 week ago

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago