22.4 Suppose we have a class Car
that represents a car. Think of some of the different pieces that a manufacturer would put together to produce a whole car. Create a class diagram (similar to Fig. 22.9) that models some of the composition relationships of class Car
.
22.5 Suppose we have a class File
that represents an electronic document in a stand-alone, non-networked computer represented by class Computer
. What sort of association exists between class Computer
and class File
?
a) Class Computer
has a one-to-one relationship with class File
.
b) Class Computer
has a many-to-one relationship with class File
.
c) Class Computer
has a one-to-many relationship with class File
.
d) Class Computer
has a many-to-many relationship with class File
.
22.6 State whether the following statement is true or false, and if false, explain why: A UML diagram in which a class’s second and third compartments are not modeled is said to be an elided diagram.
22.7 Modify the class diagram of Fig. 22.10 to include class Deposit
instead of class Withdrawal
.