Problem: Employee and ProductionWorker Classes Write a python 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. Write the appropriate accessor and mutator methods for this class. Once you have written the class, write a program that creates an object of the ProductionWorker class, and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen Note: The program should be written in python. Sample Input/Output: Enter the name: Ahmed Al-Ali Enter the ID number: 12345 Enter the department: IT Enter the job title: Programmer Enter the shift number: 1 Enter the hourly pay rate: 100 Production worker information: Name: Ahmed Al-Ali ID number: 12345 Department: IT Title: Programmer Shift: 1 Hourly Pay Rate: $100.00
Problem: Employee and ProductionWorker Classes
Write a python 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. Write the appropriate accessor and mutator methods for this class. Once you have written the class, write a program that creates an object of the ProductionWorker class, and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen
Note: The program should be written in python.
Sample Input/Output:
Enter the name: Ahmed Al-Ali
Enter the ID number: 12345
Enter the department: IT
Enter the job title: Programmer
Enter the shift number: 1
Enter the hourly pay rate: 100
Production worker information:
Name: Ahmed Al-Ali
ID number: 12345
Department: IT
Title: Programmer
Shift: 1
Hourly Pay Rate: $100.00
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images