A02

Due Date: Thursday, January 25
File(s) to be submitted: Person.java, Student.java, Undergrad.java, Graduate.java, Employee.java, Faculty.java, Staff.java, Payable.java
Sample Output: SampleOutput.html
Starter Files:


SUBMIT   /   Check

Interfaces & Inheritance

Summary

For this assignment you are to extend the Person-Student-Undergraduate inheritance hierarchy discussed in class. In particular, you are to create the classes and interface shown in this diagram:

Class Hierarchy

The four classes on the left of the diagram (Person, Student, Undergraduate, and Graduate) have already been provided.

Give each of Student, Undergraduate and Graduate a writeOutput method (as described below).

Also, revise Person so that it sorts naturally by name, and give Employee a Comparator that allows Employees to be sorted by income, from highest to lowest.

I have provided a sample program you can use to test your code. Parts of the program are commented out. You will need to activate those parts of the program as you complete each part of the assignment.

Details

Here are the descriptions of each class.

For each class you are to implement the following methods (which are the same methods you find in the classes already implemented):

The Faculty and Staff classes will, of course, also have to implement the methods given in the Payable interface.

The Employee class should define appropriate constants for the number of weeks in a year, the number of hours in a week, and the minimum wage (which I hear is $11.55 per hour). The Faculty and Staff classes should use them.

Hints

The classes you create will all be very similar to the Student and Undergraduate classes supplied to you.

The Faculty and Staff classes do not need to say that they implement Payable, even tho they do. Because they are sub-classes of Employee, the computer will know.

Test your inheritance hierarchy using the OurSchool program I have provided for you. You may want to examine it before you begin the assignment -- it has some method names that you must use.


SUBMIT   /   Check