Question: Concepts Inheritance Polymorphism Overview This homework introduces polymorphism and provides additional practice translating UML diagrams into code. Description In this assignment, you will implement the

 Concepts Inheritance Polymorphism Overview This homework introduces polymorphism and provides additionalpractice translating UML diagrams into code. Description In this assignment, you willimplement the inheritance hierarchy provided below. Notice that the Employee class has

Concepts Inheritance Polymorphism Overview This homework introduces polymorphism and provides additional practice translating UML diagrams into code. Description In this assignment, you will implement the inheritance hierarchy provided below. Notice that the Employee class has annualPay and monthlyPay methods. The annualPay method is also present in the Manager, Staff, FullTime and Part Time classes, while the monthlyPay is present in the SalariedEmployee and HourlyEmployee classes. This will give us our first look at polymorphic behavior with something other than toString. Employee name: String hireYear: int monthlyPay() annualPay() SalariedEmployee annualSalary: int monthlyPay() HourlyEmployee hoursPerWeek:int hourlyllage: double monthlyPay() Staff Manager annualPay() Full Time annual Pay() Part Time annualPay() annual Pay() Employee Class Hierarchy Implement the seven classes shown above. For the purposes of this homework. DO NOT add a toString method to any of your classes. The pay calculations should be implemented as follows: Monthly pay: Employee: simply return zero SalariedEmployee: annualSalary / 12 Hourly Employee: HoursPer Week X 4 X hourly Wage Annual pay Employee: simply return zero Manager: annual salary + 10% bonus Staff: annual salary + 2% bonus per year of service up to 5 years FullTime: 50 weeks of wages + 2 weeks wages as bonus Part Time: 50 weeks of wages (no bonus) Execution The execution class, named EmployeePay, provided here reads this data file (EmployeeData.txt) containing employee information, instantiates the appropriate objects and adds them to an ArrayList that holds Employee objects. Using a for-each loop, you will need to add the code to the displayEmployees() method in the provided EmployeePay class that iterates through the ArrayList and displays each employee's name, monthly pay and annual pay. You should call the Employee object's monthlyPay and annualPay methods to get these values. You will also need to implement all of the subclasses. Your output should look something like this: Johnson Thomas Olson Lewis Campion Davis Monthly Pay: Monthly Pay: Monthly Pay: Monthly Pay: Monthly Pay: Monthly Pay: Monthly Pay: Monthly Pay: 5416.67 8083.33 4333.33 1250.00 3000.00 8750.00 585.00 3600.00 Annual Pay: Annual Pay: Annual Pay: Annual Pay: Annual Pay: Annual Pay: Annual Pay: Annual Pay: 71500.00 106700.00 55120.00 15625.00 39000.00 115500.00 7312.50 46800.00 Wiley Parsons

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!