Skip to content

Latest commit

 

History

History

Payroll_System_Lab_4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Java - Polymorphism (Lab 4)

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 for all hours worked in excess of 40 hours, commission employees are paid a percentage of their sales and 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 implement a Java application that performs its payroll calculations polymorphically.

Create abstract super class employee to represent general concept of employee. Create the hierarchy as shown in the figure in the document.

Create an interface ‘ payable’ which defines ‘finalPaymentAmount’. Create a class ‘invoice’ which implements payable. Let employee class implements payable.