ProductsLogo
LogoStudy Documents
LogoAI Grader
LogoAI Answer
LogoAI Code Checker
LogoPlagiarism Checker
LogoAI Paraphraser
LogoAI Quiz
LogoAI Detector
PricingBlogAbout Us
logo

ATM Account State Machine Implementation

Verified

Added on  2019/09/16

|12
|463
|528
Project
AI Summary
This assignment is about implementing an ATM system using a decentralized state machine approach. The system has three states: Start, Idle, and Ready. The Start state initializes the account, the Idle state handles PIN verification and opening of the account, while the Ready state handles depositing, withdrawing, and checking balance. The system also has methods for logging out, suspending, activating, and closing the account. A sequence diagram is provided for a specific operation sequence: OPEN(123,111,1000), LOGIN(111), PIN(123), DEPOSIT(200), BALANCE(), suspend(), close.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Contents
Decentralized...................................................................................................................................2
Class Diagram..............................................................................................................................2
Sequence Diagram.....................................................................................................................10

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
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)
}

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”

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
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.

Paraphrase This Document

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

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]