Question: By completing this Lab, you will work with class inheritance, abstract classes and methods, the super keyword, method overriding, and polymorphism. Problem: For this lab,
By completing this Lab, you will work with class inheritance, abstract classes and methods, the super keyword, method overriding, and polymorphism.
Problem:
For this lab, you will implement the following class hierarchy:

You must follow the following rules:
1.Employee is an abstract class which keeps track of the Employees company, first name, and last name. It also has a toString() method that prints the users name and company. It also has two abstract methods: double getPay() and String determineBenefits()
a.Employee should ALSO have a protected DecimalFormat object set to use the format string ($##.##). Use this to format all numeric output.
2.HourlyEmployee adds wages and hours as a double and int. It implements determineBenefits, giving the employee benefits only if their hours are >= 40.
a.Page is wage * hours if hours
b.The toString, shown below, includes the weekly pay.
3.ContractEmployee adds a contract fee as a double that is an additional amount of money paid out. It does not need its own toString, but does need a getPay method which is simply hours * wages + contractFee. ContractEmployees dont get benefits.
4.SalaryEmployee adds a salary. getPay returns the salary. SalaryEmployees get standard benefits and need their own toString.
Finally, implement a menu. The menu should have the main method. The menu should store all Employees in an ArrayList
1.Adding a new Employee, which requires all the fields for the new Employee to be provided. Note that you will have to ask the user if they are adding an Hourly, Salary, or Contract employee so you know what fields to ask for!
2.Listing Employees, which means printing out all the Employees in the ArrayList
3.Printing the benefit status of all Employees in the ArrayList
4.Exiting the application
Sample Output:
Note the below does not show an implementation for 1). 1) is left for you guys!
Please select an option:
1) Add an Employee
2) List Employees
3) List Benefit Status
4) Quit
2
Mike Davenport from IPFW. This worker's pay this week was $150.00.
Rob Strongbuff from Musclemasters. This worker's pay this week was $465.00.
Conan The Barbarian from Musclemasters. This worker's pay this week was $1100.00.
Rambro Broington from Musclemasters. This worker's salary is $85000.00.
Please select an option:
1) Add an Employee
2) List Employees
3) List Benefit Status
4) Quit
3
Mike Davenport: No benefits
Rob Strongbuff: This worker gets benefits!
Conan The Barbarian: Contract workers get no benefits.
Rambro Broington: This employee has a standard company health insurance policy.
Please select an option:
1) Add an Employee
2) List Employees
3) List Benefit Status
4) Quit
4
Hourly Employee Contract Employee Employee Salary Employee
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
