Translate each sentence into a UML class diagram. Be sure to include endpoint details—ordered, unique, multiplicity, qualification, type of aggregation, etc. Look for opportunities to use association classes, enumerations, data types, anbd patterns (design & analysis).
1. A book has many chapters. A chapter has many paragraphs.
2. A network connects many computers. An internet connects many networks.
3. An engine has 4, 6, or 8 pistons.
4. A menu bar contains several menus. A menu contains several menu items.
5. A purchase order consists of a customer and a collection of products. For each product the quantity of the product is also recorded. (E.g., 10 bats, 4 balls, ...)
6. An itinerary contains a list of transits. A transit consists of a shipper, cost, duration, pick-up address and drop off address.
7. A tree consists of two types of nodes: parents and leafs. A parent node has one or more child nodes.
8. Panels and controls are GUI components. A control panel contains controls and sub-panels. Buttons, sliders, and text boxes are controls.
9. A graph consists of many nodes. A node may have many neighboring nodes. We must associate a distance to each neighbor.
10. A phone book contains many contacts indexed by their last names. A contact has a first name, last name, and one or more phone numbers indexed by their type: work, home, FAX, mobile.
11. A shipment consists of a recipient (this should be a person with an address and contact info), a status (in transit, lost, delivered, etc.) and a history of handling events (cleared customs, unloaded, loaded, etc.)
12. A procedure consists of many tasks. Depending on its predecessor, a task may also have a condition that must evaluate to true before the task can be performed.
13. An organization has a type (department, office, division, etc.) and may have several subsidiary organizations. Each link to a subsidiary organization includes the name of the liaison between the two organizations.
14. A warehouse is organized into aisles. Aisles are organized into bins, and bins are organized into shelves, one for each type of product sold. A shelf keeps track of the quantity of products it contains. A bin maintains a table that allows pickers to find the shelf of a product based on its UPC (Universal Product Code). Similarly, an aisle maintains a table that allows pickers to find the bin of a product based on its UPC. And the warehouse maintains a table that allows pickers to find the aisle of a product based on its UPC.
15. A social network consists of many members. A member has many friends. Each friend belongs to a circle: family, close, casual, or business. A member also has a blog and a feed. A blog contains many entries. A feed contains many teasers. A teaser contains a copy of the first line of a blog entry.