Write in PYTHON 3 ONLY The goal of this project is to give you more experience o
ID: 3816994 • Letter: W
Question
Write in PYTHON 3 ONLY
The goal of this project is to give you more experience on the use of:
• classes
• inheritance
• turtle graphics
• files
• lists of lists
THANK You
Write an Employee class that keeps data attributes for the following pieces of information: Employee name Employee number Next, write two classes named ProductionWorker and ShiftSupervisor that are subclasses of the Employee class Production Worker Class The ProductionWorkerclass should keep data attributes for the following information: Shift number (an integer, such as 1, 2, or 3) Hourly pay rate 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. ShiftSupervisor Class In a particular factory, a shift supervisor is a salaried employee who supervises a shift. In addition to a salary, the shift supervisor earns a yearly bonus when his or her shift meets production goals. The ShiftSupervisorclass should keep a data attribute for the: Annual salary Annual production bonus that a shift supervisor has earned Write the appropriate accessor and mutator methods for each class. Once you have written the classes, write a program that creates two objects, object of the Production Worker class and an object of ShiftSupervisor class, and prompts the user to enter data for each of the object's data attributes. Store the data in the object and then use the object's accessor methods to retrieve it and display it on the screen. Deliverables Turn in Project1.py containing all of your class and function definitions.Explanation / Answer
class Employee:
__name = ''
__number = 0
class ProductionWorker(Employee):
__shift = 0
__pay = 0
class ShiftSupervisor(Employee):
__salary = 0
__bonus = 0
emp = ProductionWorker()
sup = ShiftSupervisor()
emp.__name = input('Enter employee name: ')
emp.__number = int(input('Enter employee number: '))
emp.__shift = int(input('Enter employee shift: '))
emp.__pay = int(input('Enter employee pay: '))
print()
print('Name:', emp.__name)
print('Number:', emp.__number)
print('Shift:', emp.__shift)
print('Pay:', emp.__pay)
print()
sup.__name = input('Enter shift supervisor name: ')
sup.__number = int(input('Enter shift supervisor number: '))
sup.__shift = int(input('Enter shift supervisor shift: '))
sup.__salary = int(input('Enter shift supervisor salary: '))
sup.__bonus = int(input('Enter shift supervisor bonus: '))
print()
print('Name:', sup.__name)
print('Number:', sup.__number)
print('Shift:', sup.__shift)
print('Salary:', sup.__salary)
print('Bonus:', sup.__bonus)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.