Question: 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

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.

Do not modify the main program. complete the program by writing theread and write methods for the class workforce. The constructor must createa vector of employees. 3. In the following program an employee ofa company is represented by an object of type employee consisting of

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 write0) Information about a company's 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 defined 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 file workforcein.txt 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 O are defined for workforce The read ) and write ) methods for workforce use the read) and write () methods for employee / #ifndef WORKFORCEH #define WORKFORCE,H #include #include #include #include using namespace std; #include #include #include #include using namespace std: class employee private string name; //last name int id; float salary:// employee salary //employee id number public employee (string nnobody" int i0, float s- 0); void read (istream & in); void write (ostream & out) const; class workforce private int size vector ist;//vector of employees size of workforce public workforce (int n); void read (istream&in); void write (ostream & out) const; // set size n #endif *WORKFORCEH * Implementation of Employee and Workforce Classes /File: workforce.cpp Implementation of classes employee and workforce/ #include "workforce. h" employee:: employee (string n, int, float s) namen id salary- s void employee::read (istream & in) in name id salary void employee:: write (ostream &out) const out #include #include #include using namespace std; #include #include #include #include using namespace std: class employee private string name; //last name int id; float salary:// employee salary //employee id number public employee (string nnobody" int i0, float s- 0); void read (istream & in); void write (ostream & out) const; class workforce private int size vector ist;//vector of employees size of workforce public workforce (int n); void read (istream&in); void write (ostream & out) const; // set size n #endif *WORKFORCEH * Implementation of Employee and Workforce Classes /File: workforce.cpp Implementation of classes employee and workforce/ #include "workforce. h" employee:: employee (string n, int, float s) namen id salary- s void employee::read (istream & in) in name id salary void employee:: write (ostream &out) const out

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!