UML Diagrams for ATM System

Verified

Added on  2019/09/16

|12
|463
|528
Practical Assignment
AI Summary
This assignment focuses on creating UML diagrams for a decentralized ATM system. The solution includes a class diagram illustrating the classes Account, AccountData, and ATMState (with subclasses Start, Idle, and Ready), detailing their attributes and methods. A sequence diagram is also provided, demonstrating the interaction between these classes for a specific operation sequence: OPEN, LOGIN, PIN, DEPOSIT, BALANCE, SUSPEND, and CLOSE. The class diagram shows the relationships between the classes and their attributes and methods, while the sequence diagram visualizes the flow of interactions between objects during the execution of the specified operations. The provided code snippets show the methods within each class, illustrating the state transitions and data manipulation involved in the ATM system's functionality.
Document Page
Contents
Decentralized...................................................................................................................................2
Class Diagram..............................................................................................................................2
Sequence Diagram.....................................................................................................................10
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Decentralized
Class Diagram
Document Page
Document Page
Class Account:
S// point to current state
LS[0] // point to start state
LS[1] // point to idle state
LS[2] // point to ready state
Operations:
create(){
S->create()
}
Open(int p, int y, int a){
S->open(p,y,a);
}
Pin(int p){
S->pin(p)
}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Deposit(int d){
S->deposit(d);
}
Withdraw(int y){
S->withdraw(y);
}
Document Page
Balance(){
S->balance()
}
Logout(){
S->logout()
}
Suspend(){
S->suspend()
}
activated(){
S->activated()
}
Close(){
S->close()
}
Class AccountData:
Document Page
setPin(int pincode){
pin = pincode
}
Deposit(int d){
Balance = balance + d
}
withdraw(int w){
Balance = balance - w;
}
Balance(){
Return balance;
}
setAccountStatus(String status){
accountStatus = status;
}
Class “ATMState”: all methods are abstract methods in this class
Class “Start”
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
create(){
Account -> changeState(1)
}
Class “Idle”
pin(int p){
ad->setPin(p)
account->changeState(2)
}
open(int p,int y,int a){
ad->setPin(p)
ad->setIdentification(y)
ad->setBalance(a)
}
login(int y){
ad->setIdentification(y)
account->changeState(2)
}
Class “Ready”
Deposit(int d){
Ad.setBalance(ad.getBalance() + d);
}
Withdraw(int y){
Ad.setBalance(ad.getBalance() - w);
}
Document Page
Balance(){
Return ad.balance();
}
Logout(){
Account.changeState(1)
}
Suspend(){
Ad.setAccountStatus(“suspend”);
}
activated(){
Ad.setAccountStatus(“activated”);
}
Close(){
Account.changeState(1)
Document Page
}
Sequence Diagram
Provide a sequence diagram for the following operation sequence:
OPEN(123,111,1000), LOGIN(111), PIN(123), DEPOSIT(200), BALANCE(),
suspend(), close.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Document Page
chevron_up_icon
1 out of 12
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]