Question: from _ _ future _ _ import annotations class Employee ( object ) : A salaried employee. def _
from future import annotations
class Employeeobject:
A salaried employee.
def initself name: str salary: float None:
Initialise a new Employee instance.
Parameters:
name str: The employee's name.
salary float: The employee's annual salary.
self.name name
self.salary salary
def getnameself str:
str Return the name.
return self.name
def wageself float:
float Return the forgnightly wage.
return self.salary
Define a subclass of Employee called Worker. A worker has a manager who is another employee and this manager is given as an argument to the constructor.
Define a method in Worker
getmanagerself Employee
that returns the worker's manager.
Define a subclass of Employee called Executive. An executive has a yearly bonus in addition to a wage and this bonus is given as an argument to the constructor.
Override the Employee.wage method to take a bonus into account. You must call Employee.wage from Executive.wageusing super Remember the existing wage method calculates a fortnightly pay, but the bonus is annual.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
