| CS 261 | University of Puget Sound | Spring, 2020 |
|
Computer Science II
|
||
|
Abstract Data Types and their Implementations,
Some Basic Algorithms,
Object-oriented Problem Solving, and Efficiency |
||
Warning:
This course is under development.
Although the basic structure of this course is largely established,
nothing on this Web site should be considered official or even possibly
correct.
DO NOT MAKE PLANS BASED ON THE CONTENTS OF THIS SITE UNTIL JANUARY, 2020.
The following diagram shows the alternative Class hierarcy for the student directory example from the reading on Generalization.
Suppose further that this hierarcy is to be expanded to include a "campusLocation" and "descriptor" field, as follows.
For students, the "campus location" is the P.O. Box, and the descriptor will be "First-Year Student", "Second Year Student", "Junior", "Senior", or "Special Student".
For Staff and Faculty, the location will be their office.
For Staff, the descriptor will be their Title
For Faculty, the descriptor will be their Department
Further, boththe campus location and the descriptor should be included in every person's toString identifier.
Questions
What new fields, if any, should be added/included where?
What new methods, if any, should be added/included where?
What fields and what methods should be public?
What fields and what methods should be protected?
What fields and what methods should be private?
|
created 19 January 2020 revised 19 January 2020 |
|
| For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. |