Question: Using python write the code l class Employee (object): A salaried employee Using Inheritance Consider the following (base) class. class Employee (object) def init (self,
Using python write the code

l class Employee (object): A salaried employee Using Inheritance Consider the following (base) class. class Employee (object) def init (self, name, salary): Initialise a new Employee instance def init (self, name, salary): 10 Parameters: self. namename name (str) The employee's name salary (float): The employee's annual salary 12 13 14 15 16 17 18 19 20 21 self._salary salary return self._name return self-salary/26 def my name (self) self. name- name self._salary - salary def wage (self) ?fortnight pay def get name (self): Define a new subclass of Employee called Worker. A worker has a manager, who is another employee; their manager is given as an argument to the constructor (str) Return the name return self. name 23 24 25 26 27 28 29 30 3 1 You should define a method get manager that returns the worker's manager def wage (self): bossEmployee( 'Mr. Burns, 1000000) workerWorker 'Waylon Smithers, 2500, boss) (float) Return the forgnightly wage Define another subclass of Employee called Executive. An executive has a yearly bonus in addition to a wage return self._salary/26 Override the Employee.wage method in order to take the bonus into account. You must call Employee.wage from Executive.wage (using super). Remember that the existing wage method calculates a fortnightly pay, but the bonus is annual. executiveExecutive('Joseph Bloggs,25000, 10000)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
