Payroll System Using Polymorphism 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...


Payroll System Using Polymorphism 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 overtime pay (i.e., 1.5 times their hourly salary rate) for all hours worked more than 40 hours. Commission employees are paid a percentage of their sales. 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 to write an application that performs its payroll calculation polymorphically.









Employee












Salaried Employee












Base Plus Commission Employee












Hourly Employee












Commission Employee



Each employee has first name, last name, and SSN Salaried employee makes $800.00 Hourly employee works 40 hours a week, $16.75/hr Commission employee made sales worth $10,000, commission rate 6% Base-salary commission employee earns $300.00 base salary, 4% commission, made sales this week worth $5,000.00 Create an abstract superclass Employee Three argument constructor (first, last name, and SSN) Set and get methods for the three data fields A method that return String representation of Employee object Create salaried employee concrete class extends abstract class Employee Four argument constructor (first, last, ssn, and salary) Set and get methods for the salary A method that calculates earnings; override abstract method earnings in Employee A method return String representation of salaried employee object Create hourly employee class that extends Employee. Five argument constructor (first, last, ssn, hourly wage, hours worked) Calculate earnings method; override abstract method earnings in Employee Get and set methods A method that returns String representation of hourly employee object Apply the above technique to the Commission Employee, Base Plus Commission Employee classes Create a class to execute the five classes and output the results as it shows in the “Payroll System Test Output” text file attached. Do not send individual files, but rather zip the entire program and submit by the due date.




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here