Quiz1-KEY-Spr08 - COP4331 and EEL4884 1 Quiz 1 Solution...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4331 and EEL4884 Quiz 1 Solution KEY Spring 2008 (60 Pts) 1. (32 pts) Model each of the following object or class relationships in UML. Do this by filling in the blank with the name of the most appropriate relationship that applies from common every-day experience, or from what you have learned in this course; the relationship should dominate in your experience, it does not have to be true 100% of the time. Then give a simple UML class diagram to illustrating the relationship. For your answer choose one of the following: composition, aggregation, affiliation, association, generalization or specialization, instance-of . For example, the relationship between Quiz and Question would be modeled as composition illustrated in the diagram below. Be sure to include the multiplicity annotation and any roles that might apply. (4 pts each part, 2 for relation, 2 for diagram ) (a) Printer to Ink Cartridge Composition (b) Political Party to Voters Affiliation (c) Phone Book to Telephone Numbers Composition Give 2 points for Aggregation (if modeled correctly). Composition is most appropriate because public Phone Numbers are published in the form of a Phone Book – their lifetimes are identical. The Phone Book has no purpose outside the encapsulation of its contents – the Phone Numbers. Phone Numbers cannot be added or removed from a Phone Book – they are created together. Every issue of a Phone Book makes the previous issue obsolete. The Phone Book orders the Phone Numbers and may even group them by category: Residence, Business, Government, etc. The relationship
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Quiz1-KEY-Spr08 - COP4331 and EEL4884 1 Quiz 1 Solution...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online