Case Study ATM Project - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Case Study ATM Project

Description:

class Bank. public: Bank::Bank(); void LoadAccounts(); void SaveAccounts ... #include 'bank.h' using namespace std; class ATM. public: void PowerOn(); void Login ... – PowerPoint PPT presentation

Number of Views:2604
Avg rating:5.0/5.0
Slides: 13
Provided by: yxie
Category:
Tags: atm | bank | case | project | public | study

less

Transcript and Presenter's Notes

Title: Case Study ATM Project


1
Case Study ATM Project
  • Dr. Ying Xie

2
ATM System
BANK ----------------------- LoadAccounts S
aveAccounts VeryfyAccount MakeDeoposit MakeWithdra
wal GetBalance
ATM ----------------------- admin_ID admi
n_PIN ----------------------- PowerOn Login ServeC
ust Deposit Withdraw CheckBalance Shutdown
ACCOUNT ----------------------- id pin balance
----------------------- Deposit Withdraw GetBalan
ce GetID GetPIN
3
Class Declaration include ltstringgt class
Account public //member functions
Account() Account(string initID,
string initPIN, double initBalance) void
Deposit(double amount) void Withdraw(double
amount) double GetBalance() string
GetID() string GetPIN() private
//data members double balance string
id string pin
ACCOUNT ----------------------- ID PIN Balance
----------------------- Deposit Withdraw GetBalan
ce getID getPIN
4
Class declaration of Bank ifndef
BANK_H define BANK_H include
ltiostreamgt include ltfstreamgt include
ltstringgt include "account.h" using namespace
std class Bank public BankBank()
void LoadAccounts() void SaveAccounts()
bool VerifyAccount(string ID, string PIN)
void MakeDeposit(double amount) bool
MakeWithdraw(double amount) double
GetBalance() private Account
accounts100 int largestAccIndex int
currentAccIndex endif
BANK ----------------------- LoadAccounts S
aveAccounts VeryfyAccount MakeDeoposit MakeWithdra
wal GetBalance
ACCOUNT ----------------------- id pin balance
----------------------- Deposit Withdraw GetBalan
ce GetID GetPIN
5
Class declaration of ATM ifndef ATM_H define
ATM_H include ltiostreamgt include
ltstringgt include ltfstreamgt include
"bank.h" using namespace std class
ATM public void PowerOn() void
Login() void ServeCust() void
Deposit() void Withdraw() void
CheckBalance() void Shutdown() private
string admin_ID string admin_PIN Bank
bank endif
BANK ----------------------- LoadAccounts S
aveAccounts VeryfyAccount MakeDeoposit MakeWithdra
wal GetBalance
ATM ----------------------- admin_ID admi
n_PIN ----------------------- PowerOn Login ServeC
ust Deposit Withdraw CheckBalance Shutdown
6
ATM powers on
Account
Bank
ATM
PowerOn()
adminInfo.dat
LoadAccounts()
accInfo.dat
ifstream accInfo("accInfo.dat") largestAccIndex
-1 while(accInfogtgtidgtgtpingtgtamount)
largestAccIndex Account acc(id, pin,
amount) accountslargestAccIndex acc
Login()
7
Login
Account
Bank
ATM
Login()
id,pin
alt
not admins id and pin
VerifyAccounts(id,pin)
y/n
alt
y
ServeCust()
login()
Shutdown()
8
Serve Customer
Account
Bank
ATM
ServeCust
WDCT
alt
w
Withdraw()
D
Deposit()
C
ChechBalance()
T
Login()
9
Check Balance
AccountscurrentIndex
Bank
ATM
CheckBalance()
GetBalance()
GetBalance()
Balance
Balance
ServeCust()
10
Withdraw
AccountscurrentIndex
Bank
ATM
Withdraw()
Amount
MakeWithdraw()
Withdraw()
y/n
y/n
alt
y
print_success
ServeCust()
print_failure
ServeCust()
11
Deposit
AccountscurrentIndex
Bank
ATM
Deposit()
MakeDeposit()
Deposit()
ServeCust()
12
Shutdown
Account
Bank
ATM
Shutdown()
SaveAccounts()
accInfo.dat
ofstream accInfo("accInfo.dat") for (int
i0 iltlargestAccIndex i) accInfo
ltlt accountsi.GetID() ltlt " " ltlt
accountsi.GetPIN() ltlt " " ltlt
accountsi.GetBalance() ltlt "\n"
Write a Comment
User Comments (0)
About PowerShow.com