The payroll team needs yearly pay for two kinds of staff. Everyone gets a base salary plus a bonus; managers also get extra for each person who reports to them.
Write two classes:
Employee(name, salary) with a method yearly_pay() that returns the salary plus a 5% bonusManager(name, salary, reports) that inherits from Employee, where reports is a number of people, and whose yearly_pay() adds 1000 per report on top of what an employee getsReturn the pay rounded to 2 decimals.
How it's checked
Your code runs, then the check below runs and its printed output is compared with ours.
Employee("Ana", 60000).yearly_pay() returns 63000.0, and Manager("Ben", 80000, 3).yearly_pay() returns 87000.0Hints, the later steps and the answer come with Pro.
class Employee:
def __init__(self, name, salary):
...
class Manager(Employee):
...