Classes, Objects, Inheritance, Method overriding (toString), Array ofobjects, loopsNote: Name your classes XXXX_ProductionWorker , XXXX_ShiftSupervisor andXXXX_TestWorkerAssignment: Write the class XXXX_Worker with constructors, accessors, mutuators, and a toStringmethod. A Worker has a Worker Name and Number. Write the class XXXX_ProductionWorker which is a subclass of Worker. Theproduction worker has a shift number (values: 1 or 2) and an Hourly pay rate. A shiftnumber of 1 means the day shift and 2 means the night shift. Write the class XXXX_ShiftSupervisor which is a subclass of Worker. The shiftsupervisor is a salaried worker who supervises a shift. The shift supervisor has a yearlybonus field. The yearly bonus is earned at year end based on performance. Write a class, XXXX_TestWorker, which does the following:1. Creates one Shift Supervisor object from information entered by the user.2. Creates an Array of Production Workers that can hold 3 objects.3. It creates 3 Production Worker objects from information entered by the user4. Prints the information about each object in the format shown below using thetoString methods of the classes: Include the following for the XXXX_ProductionWorker , XXXX_ShiftSupervisorclasses: Instance variables, 2 constructors, getters, setters, toString method. Include the following for the XXXX_TestWorker class: Scanner, array of ProductionWorkers, loop to receive the user input for production workers. Use the toString methodof each class to print the information

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Classes, Objects, Inheritance, Method overriding (toString), Array of
objects, loops
Note: Name your classes XXXX_ProductionWorker , XXXX_ShiftSupervisor and
XXXX_TestWorker
Assignment:
 Write the class XXXX_Worker with constructors, accessors, mutuators, and a toString
method. A Worker has a Worker Name and Number.
 Write the class XXXX_ProductionWorker which is a subclass of Worker. The
production worker has a shift number (values: 1 or 2) and an Hourly pay rate. A shift
number of 1 means the day shift and 2 means the night shift.
 Write the class XXXX_ShiftSupervisor which is a subclass of Worker. The shift
supervisor is a salaried worker who supervises a shift. The shift supervisor has a yearly
bonus field. The yearly bonus is earned at year end based on performance.
 Write a class, XXXX_TestWorker, which does the following:
1. Creates one Shift Supervisor object from information entered by the user.
2. Creates an Array of Production Workers that can hold 3 objects.
3. It creates 3 Production Worker objects from information entered by the user
4. Prints the information about each object in the format shown below using the
toString methods of the classes:
 Include the following for the XXXX_ProductionWorker , XXXX_ShiftSupervisor
classes: Instance variables, 2 constructors, getters, setters, toString method.
 Include the following for the XXXX_TestWorker class: Scanner, array of Production
Workers, loop to receive the user input for production workers. Use the toString method
of each class to print the information

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT