Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started