Exercise Set 4: Self Referential Class Hierarchies

Exercise 4.1 Given the shopping list of groceries and the UML diagram (Figure 4.1), develop the following methods:

Exercise 4.2 Develop the collection of classes for representing a list of actors in a cast. We assume, each actor is listed only once. It is sufficient to just record actor's full name as one String: the last name followed by the first name.

Exercise 4.3 The playbill is a list of actor-role pairs, each actor and each role can be represented as one String. Every actor plays only one role.

Exercise 4.4 The course information in the registrar's database contains the course number (four digits), the course title, and the number of credits.

Exercise 4.5 A town soccer team has a phone tree to notify players about game cancellations and other changes in the schedule. Each player is assigned to call at most two other players.

Exercise 4.6 Design the class Item that contains some attribute that defines an ordering of Item objects.

Exercise 4.7 The grocery store keeps the inventory as a list of lists of grocery items of different kind (Coffee, IceCream, Juice - see an earlier exercise).