Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: Shift
Write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information:
Shift number an integer, such as or
Hourly pay rate
The workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is shift and the night shift is shift
The class's init method should have the following header:
def initself name, idnumber, shiftnumber, payrate:
The parameters, which are selfexplanatory, should be used to initialize the class attributes.
The class should have a setshiftnumber method that accepts one argument: a number representing the shift number. The method should assign this value to the attribute that holds the shift number.
The class should have a setpayrate method that accepts one argument: the employee's pay rate. The method should assign this value to the attribute that holds the pay rate.
The class should have a getshiftnumber method that accepts no arguments and returns the value of the shift number attribute.
The class should have a getpayrate method that accepts no arguments and returns the value of the pay rate attribute.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started