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 subdass 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 Sample output: Enter the nane of the shift supervisor John Snith Enter the worker number for the supervisor Enter the Bonus amount for the supervisor 10000 Enter the nane of the Production worker Terry Enter the worker number Enter the shift number Enter the Hourly pay 15 Enter the nane of the Production worker John Enter the worker number Enter the shift number Enter the Hourly pay 16 Enter the name of the Production worker Mary Enter the worker number Enter the shift nunber Enter the Hourly pay 15 Printing the Shift Supervisor Name John Smith worker Number 1 Bonus 18080.0 Printing the Production Workers Name Terry Worker Number 2 Shift 1 Pay Rate 15.8 Name John worker Number 3 Shift 2 Pay Rate 16.8 Name Mary worker Nunber 4 Shift 1 Pay Rate 15.8

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 11PP
icon
Related questions
Question
100%

Please write the following program in JAVA! Thanks, refer to photos.

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 subdass 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
Sample output:
Enter the nane of the shift supervisor
John Snith
Enter the worker number for the supervisor
Enter the Bonus amount for the supervisor
10000
Enter the nane of the Production worker
Terry
Enter the worker number
Transcribed Image Text: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 subdass 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 Sample output: Enter the nane of the shift supervisor John Snith Enter the worker number for the supervisor Enter the Bonus amount for the supervisor 10000 Enter the nane of the Production worker Terry Enter the worker number
Enter the shift number
Enter the Hourly pay
15
Enter the nane of the Production worker
John
Enter the worker number
Enter the shift number
Enter the Hourly pay
16
Enter the name of the Production worker
Mary
Enter the worker number
Enter the shift nunber
Enter the Hourly pay
15
Printing the Shift Supervisor
Name John Smith worker Number 1 Bonus 18080.0
Printing the Production Workers
Name Terry Worker Number 2 Shift 1 Pay Rate 15.8
Name John worker Number 3 Shift 2 Pay Rate 16.8
Name Mary worker Nunber 4 Shift 1 Pay Rate 15.8
Transcribed Image Text:Enter the shift number Enter the Hourly pay 15 Enter the nane of the Production worker John Enter the worker number Enter the shift number Enter the Hourly pay 16 Enter the name of the Production worker Mary Enter the worker number Enter the shift nunber Enter the Hourly pay 15 Printing the Shift Supervisor Name John Smith worker Number 1 Bonus 18080.0 Printing the Production Workers Name Terry Worker Number 2 Shift 1 Pay Rate 15.8 Name John worker Number 3 Shift 2 Pay Rate 16.8 Name Mary worker Nunber 4 Shift 1 Pay Rate 15.8
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Files and Directory
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage