- 2071 Magh · 7 marks
ATM withdrawal sequence diagram
Short answer
Collaborating objects are Customer, ATM, Card, Bank, Account. Key methods include insertCard, getAccountNumber, encrypt, verify, withdraw, dispenseCash. The ATM encrypts PIN and account number, sends to Bank for verification; if valid, prompts for amount and withdraws from Account before dispensing cash.
Find all the Methods and collaborating objects for case study given below. Based on the methods and objects identified create a sequence diagram for the following collaboration. A customer wants to draw money from his bank account. He enters his card into an ATM (automated teller machine). The ATM machine prompts "Enter PIN". The customer enters his PIN. The ATM (internally) retrieves the bank account number from the card. The ATM encrypts the PIN and the account number and sends it over to the bank. The bank verifies the encrypted Account and PIN number. If the PIN number is correct, the ATM displays "Enter amount", draws money from the bank account and pays out the amount.
Collaborating objects (classes)
Customer (actor), ATM (user interface / controller), Card, Bank (verification and transaction server), Account.
Methods identified
| Object | Methods |
|---|---|
| Customer | insertCard(), enterPIN(), enterAmount() |
| ATM | promptPIN(), readAccountNumber(), encrypt(), promptAmount(), dispenseCash() |
| Card | getAccountNumber() |
| Bank | verify(encAcc, encPIN) |
| Account | withdraw(amount), getBalance() |
Sequence diagram
Customer :ATM :Card :Bank :Account
| | | | |
| insertCard | | | |
|----------->| | | |
|"Enter PIN" | | | |
|<-----------| | | |
| enterPIN | | | |
|----------->| | | |
| | getAccountNumber() | |
| |------------>| | |
| |<- - - - - - | | |
| |--. | | |
| | | encrypt(PIN, accNo) | |
| |<-' | | |
| | verify(encAcc, encPIN) | |
| |------------------------->| |
| |<- - - valid / invalid - -| |
| [alt: PIN valid] |
|"Enter amount" | | |
|<-----------| | | |
| enterAmount| | | |
|----------->| | | |
| | withdraw(amount) | |
| |------------------------->| |
| | | | withdraw() |
| | | |------------>|
| | | |<- - - - - - |
| |<- - - - - - OK - - - - - | |
| cash | dispenseCash() | |
|<-----------| | | |
| [else: PIN invalid] ATM shows an error / retries |
Explanation
- The customer inserts the card and the ATM prompts "Enter PIN".
- After the PIN is entered, the ATM gets the account number from the card.
- The ATM encrypts the PIN and account number and sends them to the bank.
- The bank verifies them. Alternative (
altfragment): if they are invalid, the bank returns "invalid" and the ATM shows an error or lets the customer retry. - If the PIN is correct, the ATM asks for the amount, the bank withdraws it from the
Account(after checking the balance), and the ATM dispenses the cash.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- Collaboration and use case diagram case · Object Oriented Analysis and Design, chapter 2
- Money transfer sequence diagram questions · Object Oriented Analysis and Design, chapter 2
- Math Training Institute use case diagram · Object Oriented Analysis and Design, chapter 2
- Constraint specifications in bank account model · Object Oriented Analysis and Design, chapter 2
- Coffee vending machine use case diagram · Object Oriented Analysis and Design, chapter 2
- XYZ Marina class diagram · Object Oriented Analysis and Design, chapter 2
- ATM in hotel card reader failure · Instrumentation II, chapter 6
- SQL: create and use bank database · Database Management System, chapter 3
- SQL: create tables for bank schema · Database Management System, chapter 3
- Doubly linked list: bank customer records · Data Structure and Algorithm, chapter 4
All Object Oriented Analysis and Design chapter 2 questions →