7. Quiz Questions

7.1. Question 1: Statements about a Class Hierarchy

Consider the following class model:

Which of the following statements are true? Select one or more:

  1. ☐ All instances of Cde have a value for attribute a1.

  2. ☐ The standard identifier of Cde is a1.

  3. ☐ All instances of Cde may have an object reference ab referencing an object of type Bcd.

  4. ☐ Direct instances of Abc may have a value for c.

  5. ☐ For any object of type Abc the value of a3 must be greater than the value of a2.

  6. ☐ For any object of type Cde the value of a3 must be greater than the value of a2.

  7. ☐ The standard identifier of Cde is c.

7.2. Question 2: Class Hierarchy Merge

Consider the following class model:

In the case of such a simple class hierarchy, we can use the Class Hierarchy Merge design pattern where the entire class hierarchy is merged into a single class. Which of the following models describes the correct implementation of the Class Hierarchy Merge design pattern for the given Abc class hierarchy? Select one:

  1. O

  2. O

  3. O

  4. O

7.3. Question 3: Multiple Inheritance

Which of the following class models include cases of multiple inheritance? Select one or more:

7.4. Question 4: Two ways of subtyping

How can a given object type be specialized to a subtype? Select one or more:

  1. ☐ By extending the object type's intension through adding attributes or associations in the subtype.

  2. ☐ By extending the object type's extension through dropping a constraint.

  3. ☐ By restricting the object type's extension through adding a constraint.

  4. ☐ By restricting the object type's intension through dropping attributes or associations in the subtype..

7.5. Question 5: Vehicle Class Hierarchy

Consider the following class model. There are 7 object classes: Vehicle, Car, Bike, Trailer, Truck, Motorcar and Van. Car, Bike and Trailer are disjoint subclasses of Vehicle; Truck and Motorcar are disjoint subclasses of Car. Van is a subclass of Motorcar. In addition, there is the association Vehicle has Person as owner, for which the following statements hold:

  • Each Vehicle has exactly one Person as owner.

  • It is possible that some Person is not owner of any Vehicle.

  • It is possible that the same Person is owner of more than one Vehicle.

Which of the following sentences are correct on the basis of this extended model? Select one or more:

  1. ☐ It is possible that some Bike has more than one Person as owner.

  2. ☐ Each Van has at most one Person as owner.

  3. ☐ Each Person is owner of at most one Car.

  4. ☐ Each Person is owner of at least one Truck.