CIS 068 / 2: Lab - Assignment #3: Springfield Company
Assume a company having 3 types of employees:
- consultants
- secretaries and
- executives.
Consultants are payed by rate per hour(RPH) , having no base salary (BS).
Secretaries only have a base salary, whereas executives receive an additional bonus of a percentage of their salary (BP).
Secretaries and executives are not receiving any payments per hour.
These are the employees:
- Maggie, consultant, RPH = 100, hours per month: 70
- Moe, consultant, RPH = 150, hours per month: 90
- Maud, consultant, RPH = 200, hours per month: 20
- Bart, secretary, BS: 4000
- Ned, secretary, BS: 5000
- Marge, secretary, BS: 5100
- Homer, executive, BS: 12000, BP: 10%
- Lisa, executive, BS: 15000, BP: 8%
Write a program listing all names, the monthly income and the sum of all monthly incomes.
This program MUST take advantage of the structure of the given data, i.e.:
there must be the classes:
- SpringfieldCompany, containing only the static main - method (see below)
- Employee, an abstract class, defining at least the abstract method getMonthlyIncome()
- Consultant, derived from Employee
- Secretary, derived from Employee
- Executive, derived from Employee
The main-method, placed in the class springfieldCompany, MUST contain the employees in an Employee-array:
Employee theEmployees[] = new Employee(8)
This array MUST be used to compute the output !
Total points: 5
You can earn a bonus of up to 1.5 points, if the program program provides the possibility of adding other
employees interactively (= by user-input) !