Question: Consider the following Python class definition: class Employee def init__(self, n, d): self. nane n self. date0fHired def _repr__(self): Part A (5 pts) Write a

Consider the following Python class definition: class Employee def init__(self, n, d): self. nane n self. date0fHired def _repr__(self): Part A (5 pts) Write a Python class definition UnionMember which is a subclass of Employee and has return "n[Name: self. name Date of Hire:self._dateire attributes as follows: .hourly pay rate . number of hours worked whether the member is a full-time worker or part-time worker (F' for full-time, P' for part-time) Define the following methods: .a constructor which takes employee name, date of hire, hourly rate of pay, number of hours worked and whether or not the member is a full-time worker, and initializes the corresponding attributes. . a method called calcPay to compute and return the pay for a UnionMember object, calculated as follows: o if the member is a full-time worker, then the pay is number of hours worked multiplied by the hourly rate. if the member is not a full-time worker, the pay rate is 75% of the hourly rate of pay o .a__repr method which returns a string of all information about a UnionMember object. Part B (5 pts) Write a Python class definition Manager which is a subclass of UnionMember and has two attributes as follows: minimum number of employees to be supervised to obtain a bonus. actual number of employees supervised. A Manager is a UnionMember who supervises some number of employees. In addition to hourly pay, a Manager will earn a bonus when a minimum number of employees are supervised Define the following methods: .a constructor which takes employee name, date of hire, hourly rate of pay, number of hours worked, minimum number of employees, and actual number of employees supervised, and initializes the corresponding attributes. Note that all managers are full time. a method called calcPay to compute and return the pay for a Manager object, calculated as follows: . o if the manager supervises at least the minimum number of employees, then a bonus of 10% is given .a__repr method which returns al information a a Manager object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
