Question: Consider the Company class and the program output given. Now, design a class hierarchy that implements company employee's salary calculation. A company has two types

 Consider the Company class and the program output given. Now, design

Consider the Company class and the program output given. Now, design a class hierarchy that implements company employee's salary calculation. A company has two types of employees: hourly paid employees and monthly salary based employees. Every employee has a name, salary and tax rate. In addition, hourly paid employee has two attributes: hours worked and the hourly rate. The monthly paid employee has one attribute, annual salary. Both classes have constructor methods that take all attributes and a method to calculate monthly salary. Finally both classes should have the toString method that returns name, monthly salary, and the tax paid. import java.util.ArrayLiat: public class Company { public static void rain (String () args) { ArrayList empList- new ArrayList (): monthlyPaidEmp npE1 - new monthlyPaidEmp("John Willian", 55675.00)1: monthlyPaidEmp npE2 - new monthlyPaidEmp("Nancy William", 65675.00): hourlyPaidEmp hpEl - new fhourlyPaidEmp("Samira Monid", 7.50, 35): empList. add (mpEl): empList. add (mpE2): empList. add (hpEl): for(int i = 0: i empList- new ArrayList (): monthlyPaidEmp npE1 - new monthlyPaidEmp("John Willian", 55675.00)1: monthlyPaidEmp npE2 - new monthlyPaidEmp("Nancy William", 65675.00): hourlyPaidEmp hpEl - new fhourlyPaidEmp("Samira Monid", 7.50, 35): empList. add (mpEl): empList. add (mpE2): empList. add (hpEl): for(int i = 0: i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!