Question
Solve in java. Create an abstract class Employee with the following instance variables (protected): Employee name (string) Employee number (string) Hire date (string you do
- Solve in java. Create an abstract class Employee with the following instance variables (protected):
- Employee name (string)
- Employee number (string)
- Hire date (string you do not have to use the Date class)
Then create a concrete subclass: ProductionWorker that inherits from Employee, and in addition contains the following instance variables (protected):
- Hourly pay rate (double)
- Shift (in: 1 = Day, 2 = Night)
Next create a concrete subclass: ShiftSupervisor that inherits from Employee, and in addition contains the following instance variables (private):
- Annual salary (double)
- Annual bonus (double)
Lastly create a concrete subclass: TeamLeader, which inherits from ProductionWorker, and in addition contains the following instance variables (private):
- Monthly bonus (double)
- Required training hours (int)
- Number of training hours attended (int)
For each class above write one or more constructors (do not forget to call the superclasss constructor!); the get and set routines for each instance variable are optional.
Create 4 production workers, one team leader, and one shift supervisor In the main routine; do NOT prompt the user for the data). Do NOT instantiate any objects of the Employee class directly. Each class must be defined in a separate .java file; every class must have a toString() method. The main routine should be in a separate driver class, and must use each objects toString() method to display the values of the objects fields.
Step 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