Answered step by step
Verified Expert Solution
Link Copied!

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 1,2, or 3)
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 1 and the night shift is shift 2.
The class's __init__ method should have the following header:
def __init__(self, name, id_number, shift_number, pay_rate):
The parameters, which are self-explanatory, should be used to initialize the class attributes.
The class should have a set_shift_number 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 set_pay_rate 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 get_shift_number method that accepts no arguments and returns the value of the shift number attribute.
The class should have a get_pay_rate 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Withdrawals account?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago