Design a class called Employee that includes getID and getWeeklySalary methods. The class will have two variables empID and salary. The salary field contains the yearly salary amount. The getWeeklySalary method will calculate the weekly salary by dividing the salary by 52. Derive Manager and HourlyEmployee classes from the Employee class and override the getWeeklySalary methods for each. The Manager class will factor in yearly distributions to the salary from firm profits with a class variable named distribution. Call the Employee method to calculate the weekly salary and then add the distribution divided by 52. The HourlyEmployee class takes overtime into account when calculating the weekly salary. Set the overtime rate in a class variable. Write another class to test the Employee classes.
Design a class called Employee that includes getID and getWeeklySalary methods. The class will have two variables empID and salary. The salary field contains the yearly salary amount. The getWeeklySalary method will calculate the weekly salary by dividing the salary by 52. Derive Manager and HourlyEmployee classes from the Employee class and override the getWeeklySalary methods for each. The Manager class will factor in yearly distributions to the salary from firm profits with a class variable named distribution. Call the Employee method to calculate the weekly salary and then add the distribution divided by 52. The HourlyEmployee class takes overtime into account when calculating the weekly salary. Set the overtime rate in a class variable. Write another class to test the Employee classes.
Attachments: