Question: Using Python how can we set a base class Employee that has the following attributes: o Employee's name (string) o Employee's address (string) o Vehicle
Using Python how can we set a base class Employee that has the following attributes:
o Employee's name (string)
o Employee's address (string)
o Vehicle data (Vehicle object).
The child classes FullTimeEmployee, HourlyEmployee and Consultant that inherit from
Employee have the following additional properties
o FullTimeEmployee - salary (float).
o HourlyEmployee - hoursWorked (int) and hourlyRate (float).
o Consultant - hoursWorked (int) and ProjectType (valid values are 1, 2, and 3).
All these classes have the __init__ method as well as the get and set methods. In addition,
they have additional methods as described below.
Compensation for each employee type is to be computed as follows:
o FullTimeEmployee: Compensation is salary minus taxes and taxes are calculated based
on the tax rate in the table below. Please notice that this format calculates the annual
compensation and what this function needs to return is the weekly compensation
(assuming there are 52 weeks per year).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
