Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me code the following in: JAVA Please use many COMMENTS and read the task THOROUGHLY Full points will be awarded, thanks in advance!
Please help me code the following in: JAVA
Please use many COMMENTS and read the task THOROUGHLY
Full points will be awarded, thanks in advance! Employee class: HourlyWorker class: SalariedWorker class: Accountant class:
PermanentHire Class Extends SalariedWorker In this section, we'll experiment with an inheritance hierarchy that has more levels. We seek to build a Permanent Hire class that will model a full-time position as a specific kind of SalariedWorker. That is to say, a PermanentHire "is a" SalariedWorker, and a SalariedWorker "is an" Employee (and an Employee "is an" Object). (1) Download the classes outlined in the first inheritance hierarchy on page one. (Employee, SalariedWorker, HourlyWorker, Accountant) (2) Look at Accountant to see an example of inheritance already completed for you (3) Create a class called PermanentHire, and this should inherit from SalariedWorker a. public class PermanentHire extends SalariedWorker 4) Once you've built PermanentHire, then you can create constructors for your class a. See the Accountant class for examples of constructors (5) Try overriding the calculateWeeklyPay) method in your subclass so it does something different than the original version. a. Consider making PermanentHire an employee that has a base salary plus a flat bonus every month, which would require a new (overridden) calculateWeeklyPay() method. (6) Using the EmployeeDriver, build a few PermanentHires with different instance data and add them to the ArrayList of Employees Be sure to see your new PermanentHires in the console output. (7) Using the EmployeeDriver, build a ColorWithAlpha and try to add it to the ArrayList of a. Employees. What error do you encounter? What does this meanStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started