In this lab you will extend a class and use objects that inherit from other objects. You will implement a very simple employee payroll calculation system. There are two types of employees working for in the company that you are designing this program for. Some employees are payed a fixed salary while some are payed by the hour. The company works in a local with an old style progressive tax scheme. Taxes are determined based on bi-weekly gross pay and there is only one exemption available: Hourly workers are assumed to make less than salaried workers and so their first four hours of work are tax free;
The standard tax scale for taxable income is:
|BiWeekly Taxible Income of||Tax Rate|
|more than 3500||20%|
|2001 to 3500
|2000 or less
Wages mean something different for each type of employee. There is a single wage propery in the Employee class, however it means something different for each derived class.
For saleried employees the wage represents their yearly salary.
For hourly employees, the wage is their hourly wage.
As is common, you are not starting from scratch. The project has been designed
for you (see the UML below) and you have the employee class half implemented
move into the lab3 folder that was created when you unzipped the file.
Now look over the files, There is a pair of files containing the half finished Employee class. There is a header and cpp file. Compare the code to the UML diagram shown below. There aresome itemsshown on the UML that are not yet implemented. You will need to finish this class before you are done.
You will also find a file with a main function. This function will be used to test your implementation. After you have implemented all three classes, you need to do the fillowing things in the main function.
For best success, implement your project in the following order:
Implement the rest of the Employee class in Employee.cpp. There are three member functions left to implement. getTaxRate must be implemented completely. The remaining two can be "stubbed out" (given minimal implementations)
Implement the Salaried Employee class: create a header file and a cpp file and implement the SalariedEmployee in code. The member functions should be straightforward.
Add the salaried employee to the make file and compile the program. Your instructor will go over minor make file modification in the recitation class.
Implement the HourlyEmployee class: When implementing calculateGrossPay, query the user for the number of hours that this employee worked.
Add this class to the make file.
Modify the main function to create the objects listed in the summary section and print the appropriate paychecks. (you may need to call other functions between creating objects and printing paychecks of course)
Write the readme.
Due By Midnight Tuesday Oct 26th