SIMPLE COMPANY
In this homework, you'll get to work with polymorphism and apply it to modelling employees in a company. In the end, you will submit 6 les (plus the Honesty statement):
- Employee.h (de ning an Employee class and declaring its constructors/member functions and a utility function);
- HourlyWorker.h (de ning an HourlyWorker class and declaring its construc- tors/member functions);
- SalariedWorker.h (de ning a SalariedWorker class and declaring its construc- tors/member functions);
- Company.h (de ning a Company class and declaring its constructors/member functions);
- Company.cpp (giving de nitions of the previously declared functions, etc.) and main.cpp with a simple main routine. The idea is that a company has employees who may be paid hourly or by a salary. The program is very simple: from the main menu, until a user chooses to quit, they can:
- Create a new employee by selecting \C";
- Display the company directory by selecting \D";
- Set hours worked by hourly employees by selecting \H";
- Print payroll information by selecting \P". From the main menu, all other inputs are considred a Quit. Information on each employee is stored in a text le that can be read from and written to in the case of updates.
In Creating an employee, a user is asked if they wish to: Create a Salaried employee by selecting \S" and then giving the name, email address, and salary; Create an Hourly employee by selecting \H" and then giving the name, email address, and hourly rate; or Abort by selecting anything else. In Displaying, all employees of the company are printed to the console with their name, employee id, and email address. In Setting hours worked, for each hourly worker in the company, the user is prompted for how many hours they worked. In Printing payroll information, each employee is printed to the console with how much money should be on their pay cheque. The program below illustrates how the program runs with more details to follow. Given the included les \employee0.txt" and \employee1.txt" the proper be- haviour is illustrated in the screen shots below. The les \employee2.txt" and \em- ployee3.txt" are generated through the running of the program below. Note that the dollar signs $ should be printed by the program: the user does not enter those!!!!!!