Pharos University in Alexandria Software Engineering Faculty of Engineering Course code : CE352 Fifth Year Students Lecturer: Dr. Mohamed El-Basiuny Computer Engineering Department TA: Eng. Noura Samir Sheet 4: System models Answer the following questions: 1. Using the example of a retail clothing store in a mall, write a use case and draw the sequence diagram. Map the sequence diagram into a communication and an analysis class diagram. Written use case for the retail clothing store. Use Case Title: Purchase clothes Primary Actor: Customer Stakeholders: Customer, Store Clerk Preconditions: Customer pays with credit card. Minimal Guarantee: Customer peruses inventory. Success Guarantee: Customer will find and pay for desired clothing. Main success scenario— 1) Customer enters store, selects item. 2) Customer brings item to store clerk. 3) Clerk receives item and removes hangers, security tags. 4) Clerk determines price. 5) If item on sale, clerk calculates discount. 6) Clerk calculates tax. 7) Clerk sums total amount due. 8) Clerk informs customer of amount due. 9) Customer confirms purchase decision, provides credit card. 10) Clerk charges credit card amount due. 11) Register adjusts inventory. 12) Clerk provides receipt to customer, sale complete. Extensions— 1) Item not found—customer tries another store. 10) Credit card will not accept charge—clerk asks for cash. 2. Using the example of a loan management system, write a high-level use case and draw the sequence diagram. Map the sequence diagram into an analysis class diagram. Written use case for the loan management system: Use Case Title: Manage loan Primary Actor: Customer Level: Kite Stakeholders: Customer, Loan Officer Preconditions: Customer has selected an item to purchase on credit. Minimal Guarantee: Customer will be able to apply for a loan. Success Guarantee: Customer will be approved for loan and will receive a check. Main success scenario— 1) Customer enters office, fills out application. 2) Customer brings application to loan officer. 3) Loan officer receives application and checks it for completeness. 4) Loan officer verifies information on application. 5) Loan officer determines that customer is credit worthy. 6) Loan officer determines if item to be purchased has enough value to warrant the loan. 7) Loan officer requires customer to sign the required paperwork for the loan. 8) Loan officer write the loan check in the amount approved and the loan is complete. Extensions— 3) Application is not complete. Officer requests that customer complete application. 4) 5) 6) 7) Application is not correct. Officer requests correct data from customer Customer is not credit worthy. Loan is denied. Item does not have sufficient value. Loan is denied. Customer refuses to sign paperwork. Loan is denied. 3. Write a use case for typical car maintenance and repair service. Note that a car repair involves servicing as well as replacing parts. Consider parts vendors as actors outside your system. The customer may request the history of maintenance and repairs on a vehicle before ordering service. Draw the sequence diagram and translate it to a communication diagram. Map the sequence diagram into an analysis class diagram. This is a complicated scenario that might easily make more than a single use case. Students should be extended latitude in the detail of their answers, provided they abide the rules of robustness and normality. A use case might read as below: Use Case Title: Auto maintenance and repair Primary Actor: Customer Level: Kite Stakeholders: Customer, Parts vendor Preconditions: Customer owns a vehicle with a problem. Minimal Guarantee: Vehicle condition will be evaluated. Success Guarantee: Vehicle will be repaired appropriately. Main success scenario— 1) Customer enters shop and requests help with vehicular problem. 2) Attendant obtains customer and vehicle information. 3) Diagnose actual problem. 4) Determine if vehicle requires maintenance or repair. 5) If maintenance is required, service accordingly. 6) If repair is required, determine if repair involves fixing or replacing vehicle parts. 7) If able to fix the part, perform repair. 8) If a new part is required, obtain part from vendor, then repair. 9) Update vehicle history. 10) Prepare bill for the customer. 11) Present bill for payment. 12) Receive payment (cash or credit) from customer and return keys. Extensions— 3) Unable to diagnose problem—take vehicle to another shop. 8) Part not available—offer customer a courtesy vehicle. 12) Customer unable to pay—retain keys of vehicle until customer returns with cash. 4. Draw state machine models of control software for: 1) At the Sunbelt University, student registration for courses occurs at certain designated times. When the registration period starts, courses are initialized, which implies that the courses are entered into the system along with their maximum allowed enrollments, commonly called caps. Students enroll in the courses. However, when a course reaches its cap, the course is closed. A student can enroll in a closed course only by obtaining written permission from the instructor teaching the course. If a course exceeds its cap, it is called overfull. A student can drop a course, which can lead to the opening of a capped course. Courses that have enrollments of less than 25 percent of the cap are dropped automatically. Courses that have enrollments between 25 percent and 40 percent are listed by department, and the lists are sent to the respective department heads. These courses are called contingent because the approval is dependent on the decision of the department head. A chairperson must decide within 1 week of the receipt of the list whether or not a contingent course will be offered; otherwise, the course is dropped. Courses that have enrollment greater than 40 percent and the ones specifically approved by a chairperson are offered. 2) An automatic washing machine that has different programs for different types of clothes consultant 3) The software for a DVD player. 5. Draw a context model for a patient information system in a hospital. You may make any reasonable assumptions about the other hospital systems which are available but your model must include a patient admissions system and an image storage system for X-rays.