Solution to A company pays its employees on a weekly basis. The employees are of four types: … - Sikademy

Nov. 28, 2020

Archangel Macsika Sikademy Image

Archangel Macsika

A company pays its employees on a weekly basis. The employees are of four types: Salaried employees are paid a fixed weekly salary regardless of the number of hours worked, hourly employees are paid by the hour and receive “time-and-a-half” overtime pay (i.e., 1.5 times their hourly salary rate) for all hours worked in excess of 40 hours, commission employees are paid a percentage of their sales and base-salaried-commission-employees receive a base salary plus a percentage of their sales. For the current pay period, the company has decided to reward salaried-commission employees by adding 10% to their base salaries. The company wants you to write an application that performs its payroll calculations polymorphically. Use abstract class Employee to represent the general concept of an employee. The classes that extend Employee are SalariedEmployee, CommissionEmployee and Hourly-Employee. Class BasePlusCommissionEmployee which extends CommissionEmployee represents the last employee type.

Solution

Employee.java

HourlyEmployee.java

SalariedEmployee.java

CommissionEmployee.java

BasePlusCommissionEmployee.java

Main Class