Draw an inheritance hierarchy for students at a university similar to the hierarchy shown in Fig. 12.2. Use Student as the base class of the hierarchy, then include classes UndergraduateStudent and GraduateStudent that derive from Student. Continue to extend the hierarchy as deep (i.e., as many levels) as possible. For example, Freshman, Sophomore, Junior and Senior might derive from UndergraduateStudent, and DoctoralStudent and MastersStudent might derive from Graduate-Student. After drawing the hierarchy, discuss the relationships that exist between the classes. [Note: You do not need to write any code for this exercise.]

What will be an ideal response?


This hierarchy contains many “is-a” (inheritance) relationships. An UndergraduateStudent is a Student. A GraduateStudent is a Student, too. Each of the classes Freshman, Sophomore, Junior and Senior is an UndergraduateStudent and is a Student. Each of the classes DoctoralStudent and MastersStudent is a GraduateStudent and is a Student.

Computer Science & Information Technology

You might also like to view...

This property allows the developer to specify the type of files that will appear in a dialog box.

a. InitialFile property b. FileFilter property c. Files property d. Filter property

Computer Science & Information Technology

If the maximum frequency audible to a human ear is 20,000 Hz, at what rate must the analog signal from a microphone be sampled when converting it to digital?

What will be an ideal response?

Computer Science & Information Technology

What are the three groups of organizational fundamentals that carry implications for the development of information systems?

What will be an ideal response?

Computer Science & Information Technology

A(n) _________ is a sequence of either alpha or alphanumeric characters

Fill in the blank(s) with correct word

Computer Science & Information Technology