Question: Using Python... write the code 1 class Employee(object): Consider the following (base) class. A salaried employee class Employee (object) def salary): -init-(self, self-name = name

Using Python... write the code

Using Python... write the code 1 class Employee(object): Consider the following (base)

1 class Employee(object): Consider the following (base) class. A salaried employee class Employee (object) def salary): -init-(self, self-name = name self._salary salary name, def -init-(self, Initialise a new Employee instance Parameters: name, salary): def my_name (self): return self. name 10 name (str): The employee's name salary (float): The employee's annual salary def wage(self) return 12 13 14 15 16 17 18 19 20 21 self-salary/26 # fortnight pay self, name = name self._salary salary 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 def get name (self): You should define a method get_manager that returns the worker's manager (str) Return the name bossEmployee( "Mr. Burns', 1000000) workerWorkerWaylon Smithers',2500, boss) 23 24 25 26 27 28 29 30 31 return self._name Define another subclass of Employee called Executive. An executive has a yearly bonus in addition to a wage def wage (self): (float) Return the forgnightly wage 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 return self._salary/26 executiveExecutive Joseph Bloggs'25000, 10000)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!