Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

What are the factors that influence make or buy decisions ?

Answered: 1 week ago