Menu

[Solved]-Python Employee Productionworker Classes Write Employee Class Keeps Data Attributes Follow Q37254766

Python

Employee and ProductionWorker Classes

Write an Employee class that keeps data attributes for thefollowing pieces of information:

  • Employee name
  • Employee number

Next, write a class named ProductionWorker that is a subclass ofthe Employee class. The ProductionWorker class should keep dataattributes for the following information:

  • Shift number (an integer, 1 or 2)
  • Hourly pay rate

The workday is divided into two shifts: day (1) and night(2).

Write the appropriate accessor and mutator methods for eachclass.

Once you have written the classes, write a program that createsan object of the ProductionWorker class and prompts the user toenter data for each of the object’s data attributes. Store the datain the object, then use the object’s accessor methods to retrieveit and display it on the screen.

Sample output(s):

Enter the name: Bill Smith
Enter the ID number: 1001
Enter the shift number: 1
Enter the hourly pay rate: 10.00
Production worker information:
Name: Bill Smith ID number: 1001
Shift: 1
Hourly Pay Rate: $10.00

Expert Answer


Answer to Python Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the following pieces… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *