Question: Consider the following Python class definition: class Employee: def _init__(self, n, d): self. namen sel dateOfHire def _repr_(self) return [Name : self. amet, Date

 Consider the following Python class definition: class Employee: def _init__(self, n,d): self. namen sel dateOfHire def _repr_(self) return " [Name : self.

Consider the following Python class definition: class Employee: def _init__(self, n, d): self. namen sel dateOfHire def _repr_(self) return " [Name : self. amet", Date of Hire: self.--dateOfHre+"]" Part A (5 pts) Write a Python class definition UnionMember which is a subclass of Employee and has attributes as follows: hourly pay rate e 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 . a repr method which returns a string of all information about a UnionMember object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!