Reyan Younous Rana
BC220410546
Assignment No. 02
Semester: Fall 2024
Software Engineering-1 (CS504)
Here’s a step-by-step breakdown for the sequence diagram:
Participants:
1. Customer: The user of the vending machine.
2. Vending Machine: Handles the process of selling items.
3. Smart Card Reader: Validates the card and updates the balance.
4. Items Stock: Checks item availability.
Sequence Diagram Actions:
1. Insert Smart Card
Customer → Vending Machine: Insert Smart Card.
Vending Machine → Smart Card Reader: Validate Card.
2. Validate Card
Smart Card Reader → Vending Machine: Validity Status (True/False).
3. Choose Item
Customer → Vending Machine: Choose an Item.
4. Check Item Availability
Vending Machine → Items Stock: Check Item Availability.
Items Stock → Vending Machine: Item Available (True/False).
5. Purchase Item (if available)
Vending Machine → Smart Card Reader: Deduct Item Price from Card Balance.
Smart Card Reader → Vending Machine: Updated Balance.
6. Dispense Item and Release Card
Vending Machine → Customer: Dispense Item and Release Card.
Notations:
Sequence Diagram Symbols:
1. Actor: Represented as a stick figure (Customer).
2. Objects: Represented as rectangles (Vending Machine, Smart Card Reader, Items Stock).
3. Messages: Represented as arrows with labels showing the message content.
4. Lifelines: Dashed vertical lines showing the lifecycle of each participant.
5. Activation Bars: Thin rectangles on the lifeline showing an object is active during a
process.