---
title: "Money transfer sequence diagram questions"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:money-transfer-sequence-diagram"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/money-transfer-sequence-diagram
site: BCT Engineering
---

# Money transfer sequence diagram questions

Object Oriented Analysis and Design · Chapter 2: Object Oriented Analysis

- Asked in: 2069 Bhadra, 3×3 marks
- Video: [Sequence Diagram in UML | Software Engineering](https://www.youtube.com/watch?v=VnRQ5CNC4Fs) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/money-transfer-sequence-diagram
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

Based on the below diagram for model action of money transfer, answer the following questions:
(a) How many numbers of classes are involved in this transfer activity? What are they?
(b) What are the events followed for transfer complete?
(c) Why this check( ) function is required for this transfer?
[Figure: sequence diagram with lifelines a1:Account, a2:Account and John:Person. a1:Account receives the message xfer(m:Money, a2), then calls check() on itself with a return 'evaluation'; then, if [OK], calls minus(m) on itself and sends plus(m) to a2:Account.]

## Short answer

Two classes (Account and Person); events: John sends xfer(m,a2), a1 calls check(), if OK a1.minus(m) and sends plus(m) to a2; check() ensures sufficient balance and account validity, preventing invalid transfers.

## Answer

#### (a) Number of classes involved
Two classes are involved: **Account** (the lifelines `a1:Account` and `a2:Account` are two objects of the same class) and **Person** (`John:Person`, the actor/initiator). So there are three objects but two classes.

#### (b) Events followed for the transfer to complete
1. `John` sends `xfer(m:Money, a2)` to `a1:Account`.
2. `a1` calls `check()` on itself to evaluate whether the balance is sufficient; it returns `evaluation`.
3. If the result is **[OK]**, `a1` calls `minus(m)` on itself to reduce its balance by `m`.
4. `a1` sends `plus(m)` to `a2:Account`, which increases its balance by `m`.
5. The transfer is complete; control returns to John.

```text
 John:Person   a1:Account     a2:Account
     |  xfer(m,a2) |              |
     |------------>|              |
     |             |--check()-.   |
     |             |<-evaluation  |
     |             |  [OK]        |
     |             |--minus(m)-.  |
     |             |------plus(m)>|
```

#### (c) Why check() is required
`check()` verifies the business rule that the source account has enough balance (and is valid/active) before any money is moved. Its result (`evaluation`) is the guard **[OK]** for the following messages. Without it, `a1` could be overdrawn, or money could be transferred out of an invalid or blocked account, leaving the accounts in an invalid state. Because both `minus(m)` and `plus(m)` are sent only when the guard is [OK], a failed check stops the whole transfer before any balance changes.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How many classes and objects are in the transfer diagram?
   A. Three classes, two objects
   B. Two classes (Account, Person) and three objects (a1, a2, John)
   C. Three classes and three objects
   D. One class
   Answer: B. a1 and a2 are two objects of the same class Account. (Key point: Classes involved)

2. What is the correct order of events?
   A. plus(m) on a2, check(), minus(m)
   B. xfer(m, a2) to a1, check(), then if [OK] minus(m) on a1 and plus(m) to a2
   C. minus(m), check(), xfer
   D. check() on a2 first
   Answer: B. John sends xfer; a1 checks itself, debits, then credits a2. (Key point: Event order)

3. Why is check() required?
   A. To verify the source account has enough balance and is valid, so the account is not overdrawn and the system stays consistent
   B. To print a receipt
   C. To credit a2
   D. To delete a1
   Answer: A. minus and plus are guarded by [OK], so either both happen or neither. (Key point: Purpose of check())

## Related in Object Oriented Analysis and Design

- [ATM withdrawal sequence diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aatm-withdrawal-sequence-diagram) — Object Oriented Analysis and Design, chapter 2
- [Explain online order sequence diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aorder-processing-sequence-diagram-explain) — Object Oriented Analysis and Design, chapter 2
- [Map sequence diagram to pseudo code](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aorder-model-mapping-pseudocode) — Object Oriented Analysis and Design, chapter 4
- [Identify conceptual classes; create domain model](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aconceptual-classes-domain-model-steps) — Object Oriented Analysis and Design, chapter 2
- [Essential components of an activity diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aactivity-diagram-components) — Object Oriented Analysis and Design, chapter 2
- [External actors and library system sequence diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aexternal-actors-library-system-sequence-diagram) — Object Oriented Analysis and Design, chapter 2

## Related in other subjects

- [Transfer function from state model [0 1; −5 −6]](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Ass-tf-0-1-5-6) — Control Systems, chapter 8, asked 3×
- [Armature-controlled DC motor transfer function and block diagram](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Atf-armature-dc-motor) — Control Systems, chapter 2
- [PID controller block diagram, transfer function, characteristics](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Apid-bd-tf-characteristics) — Control Systems, chapter 7
- [Succession of events; GPSS telephone model](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Agpss-telephone-system) — Simulation and Modeling, chapter 9
