Chapter 15 Answers to Exercises 1a. Develop a use case diagram for a convenience food store. Include an actor representing the store manager and use cases for orderItem(), stockItem() and sellItem(). orderItem() stockItem() store manager sellItem() b. Add more use cases to the diagram you created in Exercise 1a. Include two generalizations for stockItem(): stockPerishable() and stockNonPerishable(). Also include an extension to sellItem() to checkCredit() when a customer purchases items using a credit card. orderItem() stockPerishable() stockItem() stockNonPerishable() store manager sellItem() checkCredit() c. Add a customer actor to the use case diagram you created in Exercise 1b. Show that the customer participates in sellItem() but not in orderItem() or stockItem(). 2. Develop a use case diagram for a department store credit card system. Include at least two actors and four use cases. application() cardTransaction() store processBill() reconcileTransactions() customer 3. Develop a use case diagram for a college registration system. Include at least three actors and five use cases. application() createClasses() registrar assignClasses() student dropClasses() billStudent() instructor 4. Develop a class diagram for a Video class describing objects that a video store customer can rent. Include at least four attributes and three methods. Video IdNum Title runningTime rentalFee create() getInfo(idNum, title, runningTime, rentalFee) chargeFee() 5. Develop a class diagram for a Shape class. Include generalizations for child classes Rectangle, Circle and Triangle. Shape numSides create() getInfo(numSides) Rectangle Circle Triangle widthSize heightSize diameter side1Length side2Length side3Length create() getInfo(widthSize, heightSize) calcPerimeter() calcArea() create() getInfo(diameter) calcCircumference () calcArea() create() getInfo(side1Length, side2Length, side3Length) calcArea() 6. Develop a class diagram for a BankLoan class. Include generalizations for child classes Mortgage, CarLoan, and EducationLoan. 7. Develop a class diagram for a college registration system. Include at least three classes that cooperate to achieve student registration. Class 0..* 0..30 classId instructorId className credits Student idNum name create() getInfo(idNum) schedule() create() getInfo() 0..180 0..* 0..6 1 Instructor idNum name department create() getInfo(idNum) schedule() 8. Develop a sequence diagram that shows how a clerk at a mail order company places a customer Order. The Order accesses Inventory to check availability. Then the Order accesses Invoice to produce a customer invoice which returns to the clerk. Order Inventory clerk getInfo(orderNum) create(Order orderNum, Inventory idNum} (invenInfo) getInfo(orderNum) (invoiceInfo) (invoice) Invoice 9. Develop a statechart diagram that shows the states of a CollegeStudent from PotentialApplicant to Graduate. gradHighSchool() Potential applicant apply() Applicant accept() New student register() Current student graduate() Graduate 10. Develop a statechart diagram that shows the states of a Book from Concept to Publication. generateConcept() Concept pitchToPublisher() Contracted write() Awaiting publication publish() Published 11. Develop an activity diagram that illustrates how to build a house. createFloorPlan() [Owner can serve as contractor] hireIndividualWorkers() [Owner cannot serve as contractor] hireGeneralContractor eBook() buildHouse() 12. Develop an activity diagram that illustrates how to prepare dinner. Student Answers will vary widely. 13. Develop the UML diagram of your choice that illustrates some aspect of your life. Student Answers will vary widely. 14. Complete the following tasks: a. Develop the UML diagram of your choice that best illustrates some aspect of a place you have worked. b. Develop a different UML diagram type that illustrates the same functions as the diagram you created in Exercise 14a. Student Answers will vary widely.