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: Creates one Shift Supervisor object from information entered by the user. Creates an Array of Production Workers that can hold 3 objects. Itcreates3ProductionWorkerobjectsfrominformationenteredbytheuser 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 Sample output: Enter the name of the shift supervisor John SmithEnter the Worker number for the supervisor 1 Enter the Bonus amount for the supervisor 10000Enter the name of the Production Worker Terry Enter the Worker number 2 1 CPS 2231 Computer Organization and Programming Enter the shift number 1 Enter the Hourly pay 15 Enter the name of the Production Worker JohnEnter the Worker number3 Enter the shift number 2 Enter the Hourly pay 16 Enter the name of the Production Worker Mary Enter the Worker number 4 Enter the shift number 1 Enter the Hourly pay 15 Printing the Shift SupervisorName John Smith Worker Number 1 Bonus 10000.0 Printing the Production WorkersName Terry Worker Number 2 Shift 1 Pay Rate 15.0 Name John Worker Number 3 Shift 2 Pay Rate 16.0 Name Mary Worker Number 4 Shift 1 Pay Rate 15.0

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

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

    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

    Sample output:

    Enter the name of the shift supervisor John Smith
    Enter the Worker number for the supervisor 1

    Enter the Bonus amount for the supervisor 10000
    Enter the name of the Production Worker Terry

    Enter the Worker number 2

1

CPS 2231 Computer Organization and Programming

Enter the shift number 1 Enter the Hourly pay 15

Enter the name of the Production Worker John
Enter the Worker number
3

Enter the shift number 2 Enter the Hourly pay 16 Enter the name of the Production Worker Mary Enter the Worker number 4 Enter the shift number 1 Enter the Hourly pay 15

Printing the Shift Supervisor
Name John Smith Worker Number 1 Bonus 10000.0

Printing the Production Workers
Name Terry Worker Number 2 Shift 1 Pay Rate 15.0 Name John Worker Number 3 Shift 2 Pay Rate 16.0 Name Mary Worker Number 4 Shift 1 Pay Rate 15.0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 1 images

Blurred answer
Knowledge Booster
Class
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning