Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

How has the competition changed within the last three years?

Answered: 1 week ago