Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started