Exercise on Inheritance

Instructions:
  1. Start with this JCreator project . It contains an Employee class and a tester class (CompanySimulation).
  2. Create Java classes Manager and Secretary that are subclasses of Employee. A manager is an employee who has a bonus over and above his/her salary. A secretary is an Employee who reports to a boss. For Manager, you will need to define a 3-parameter constructor (indicating name, salary, and bonus) and a getBonus() method. For Secretary, you will need to define a 3-parameter constructor (indicating name,salary, and manager) and a getBossName() method. When you execute CompanySimulation, the output should be as follows:
    Wayland's boss is Montgomery
    Montgomery has an additional bonus of 20000.0
    ----------
    Homer's salary is 10000.0
    Montgomery's salary is 100000.0
    Wayland's salary is 20000.0
    Carl's salary is 11111.0
    Lenny's salary is 12345.0
    ----------
    Salary of Homer is 10500.0
    Salary of Montgomery is 105000.0
    Salary of Wayland is 21000.0
    Salary of Carl is 11666.55
    Salary of Lenny is 12962.25
    
  3. Using method overriding, arrange it so that a secretary gets a 10% salary increase instead of the usual 5% for employees in general. Also, arrange it so that when printing the salary package of a manager, print the manager's bonus. The output for CompanySimulation would now be:
    Wayland's boss is Montgomery
    Montgomery has an additional bonus of 20000.0
    ----------
    Homer's salary is 10000.0
    Montgomery's salary is 100000.0
    Wayland's salary is 20000.0
    Carl's salary is 11111.0
    Lenny's salary is 12345.0
    ----------
    Salary of Homer is 10500.0
    Salary of Montgomery is 105000.0 with a bonus of 20000.0
    Salary of Wayland is 22000.0
    Salary of Carl is 11666.55
    Salary of Lenny is 12962.25 with a bonus of 100.0
    
  4. No submission required for this exercise unless otherwise specified by your instructor.