Draw an inheritance hierarchy for students at a university similar to the hierarchy. 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 Masters- Student might derive from GraduateStudent. 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...

The default text wrap setting when a picture is inserted is ________

A) In Line with Text B) Square C) Tight D) Top and Bottom

Computer Science & Information Technology

Corporate Web sites are often the company's more formal channel of communication.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

?In Microsoft Edge, you can switch to Reading View, which __________. 

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

When a picture is applied to a slide background using the Format Background option, you can move or resize the picture.

a. true b. false

Computer Science & Information Technology