Question: Need help with Java code. Design a class named Employee. The class should keep the following information: name ( s string ) id number (
Need help with Java code.
Design a class named Employee. The class should keep the following information:
name s string
id number a string
salary a double
default constructor
a constructor with parameters for the attributes
get and set methods for the three attributes.
toString method.
Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information:
shift an integer
hours an integer
hourly pay rate a double
default constructor
constructor with parameters for all attributes the salary will be calculated by pay rate hours
get and set methods
toString method.
The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee works. The day shift is shift and the night shift is shift The salary is calculated as hourly pay rate hours per week.
Write a class named ShiftSupervisor. A shift supervisor is a salaried employee who supervises a shift. In addition to a salary, the shift supervisor earns a monthly bonus when his or her shift meets production goals. Design a ShiftSupervisor class that is derived from the Employee class. The salary is calculated by salary plus the bonus. The ShiftSupervisor class should have the following information:
bonus a double
default constructor
constructor with parameters for all attributes
get and set methods
toString method.
Test the classes by writing and running the program Labjava that create one Employee object, one ProductionWorker object, and one ShiftSupervisor object using the constructors with parameters. And display the objects information.
Submission:
Employee.java
ProductionWorker.java
ShiftSupervisor.java
Labjava
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
