41-Section-Handout

41-Section-Handout - CS107 Spring 2007 Handou t 41 Section...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS107 Handout 41 Spring 2007 June 1, 2007 Section Handout: Java Inheritance Problem 1: Stanford Instructors For this problem, you will design Java classes suitable for storing information about university instructors. The goal of the example is to demonstrate arranging classes in a hierarchy for maximum code sharing. There are three types of instructor: Faculty , Lecturer , and GradStudent . 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 be initialized with their age (and by setting them to have no unread mail and no eccentricities). There are two measures of an instructor's current mood: stress and respect. stress: 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. respect:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

41-Section-Handout - CS107 Spring 2007 Handou t 41 Section...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online