"""
Exercise 3: override, extend, and duck-typed polymorphism

Part A: implement class Employee with __init__(name, base_salary) and
a method pay(self) returning base_salary. Implement class Manager(Employee)
that OVERRIDES __init__ to accept an extra `bonus` argument, calling
super().__init__() for the shared part, and overrides pay() to EXTEND
the base behavior: super().pay() + bonus.

Part B: implement describe_payroll(employees) that takes a mixed list
of Employee/Manager instances and returns the total of everyone's
pay() — again, no isinstance checks, just polymorphism.
"""

class Employee:
    def __init__(self, name, base_salary):
        # TODO
        pass

    def pay(self):
        # TODO
        pass


class Manager(Employee):
    def __init__(self, name, base_salary, bonus):
        # TODO: call super().__init__ for name/base_salary, store bonus
        pass

    def pay(self):
        # TODO: super().pay() + bonus
        pass


def describe_payroll(employees):
    # TODO: sum of pay() across the list, no isinstance checks
    pass


# --- self-check: do not modify below this line ---
staff = [
    Employee("Ana", 3000),
    Manager("Bob", 4000, 1000),
    Employee("Cy", 3200),
]

checks = [
    (staff[1].pay(), 5000),
    (describe_payroll(staff), 3000 + 5000 + 3200),
    (isinstance(staff[1], Employee), True),  # Manager IS an Employee
]

all_passed = all(actual == expected for actual, expected in checks)
for actual, expected in checks:
    print(f"got {actual!r}, expected {expected!r} -> {'PASS' if actual == expected else 'FAIL'}")

print("ALL PASS" if all_passed else "SOME FAILED")
