Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions