LabInheritance PDF
LabInheritance PDF
Inheritance Lab
You are a programmer in the IT department of an important law firm. Your job is to create a program
that will report gross salary amounts and other compensation.
Your computer-based solution will use inheritance to reflect the general-to-specific nature of your
employee hierarchy.
Requirements:
o Each subclass of Employee must implement its own reportSalary() method. The specific
implementations of reportSalary() are limited to a printed line:
o Salaries for specific types of employees are in addition to the base employee salary.
Raising the base employee salary should automatically raise salaries for all types of
employees (hmmm).
o An object of the Employee class cannot be instantiated because it would be too
general.
o Attribute(s) that belong to a super or sub class should be initialized in the corresponding
class constructor.
Task 1:
Setup a class hierarchy to accurately reflect the relationships in your law firm.
Task 2:
Create a driver program that will create employee objects and report salaries for your companys
employee base:
Print your code listing and submit on paper, in class. See Canvas for due date.