Exercise Set 3: Simple Class Hierarchy

Exercise 3.1 Given a class hierarchy to represent information about people at a university, including the classes Person, Instructor, and Staff:

Exercise 3.2 Given a UML class hierarchy to represent items in the grocery store, develop the classes Grocery, Coffee, Juice, and IceCream as specified in the UML diagram.

Exercise 3.3 Develop a class hierarchy to represent three different types of vehicles: cars, trucks, and buses. For all vehicles we need to record the size of the fuel tank in gallons, and the estimated fuel consumption given in miles per gallon. Just like the class Car in an earlier exercise, we can compute:

Exercise 3.4 Warning: This exercise can be completed independently of the previous exercise.
Develop a class hierarchy to represent three different types of vehicles: cars, trucks, and buses. Different kinds of vehicles need to represent additional information as follows:

Develop the method computeToll, which will compute the toll for each vehicle according to the following rules:

Exercise 3.5

Exercise 3.6