Homework 3
CS202, Summer 2006

Due: Tuesday, July 25

Please upload your source code files using CSNS. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.



1. Read the following sections of SUN's Java Tutorial
2.(60pt) [Stanford]  For this problem, you will design and implement Java classes suitable for storing information about university instructors. There are three types of instructor: Professor, Lecturer, and Grad student. At any time, an instructor can best be described by three quantities: number of unread e-mail messages, age, and number of eccentricities. An instructor should respond to an init message which sets their age and sets them to have no unread mail and no eccentricities.

There are two measures of an instructor's current mood: stress and respect. An instructor's stress level is the number of unread messages.
However, stress is never more than 1000. Grad students are the exception. Their stress is double the number of unread messages and their maximum stress is 2000. Generally, an instructor's level of respect in the community is their age minus the number of eccentricities. Respect can never be negative. Professors are the exception: a Professor's eccentricities are regarded as "signs of a troubled genius" thereby increasing respect. So for Professors respect is age plus number of eccentricities.

Everything in an instructor's life is driven by receiving e-mail. Several things happen when an instructor gets new, unread e-mail:
To receive full credit for this exercise, you must take advantage of inheritance to maximize code re-use, and it goes without saying that you need some testing code, e.g. a InstructorTest.java program, to make sure your classes and methods work properly.