Make your own free website on Tripod.com

Object-oriented analysis


A product is to be install control software for ATM. The problem concerns the financial transaction to the following constraints.

C1: Each card has PIN. If the PIN is incorret then card reject.

C2: Deposit. Print report showing the date, amount depositted, and account number

C3: Withdraw up to $200 in units of $20 and account may not be overdrawn. Print report showing the date, amount withdraw, account number, and account balance.

C4: Determine account balance. On sreen display

C5: Transfer funds between accounts. The transfering account can not be overdraw. Print report showing the date, amount transfer, and two account number

C6: Card reject if PIN number is incorrect or quit

 

1.Class modeling

Stage 1: Concise Problem Definition

The ATM controlled withdraw, deposite, account balance and transfer funds. To access the account. user have to enter correct PIN number. Quit to terminated the transaction.

Stage 2: Informal Strategy

The ATM controlled withdraw, deposite, account balance and transfer funds. To access the account. user have to enter correct PIN number. Quit to terminated the transaction. Print report for any financial transaction and reject card in case of incorrect PIN number, quit or completion on the transaction.

Stage 3: Formalize the strategy

The Atm controlled withdraw, deposite, account balance and transfer funds. To access the account. user have to enter correct PIN number. Quit to terminated the transaction. Print report for any financial transaction and reject card in case of incorrect PIN number, quit or completion on the transaction.

There are three class as ATM class, Transaction class, and Report class. The problem specified four operation of financial transaction so that their four method of transaction class as Withdraw, Deposite, Balance, and Transfer class. The report also contents four method as descriped above.

2.Dynamic modeling

Dynamic model for ATM class is shown as below

Dynamic model for Transaction class is shown as below

Dynamic model for Printer class is shown as below

3. Functional modeling


 

 

Object-oriented design


1. Determine the actions of the class

 

 Class  Attributes  Methods
 ATM  PIN number  GetPIN
   Account data structure  VerifyPIN
     Quit
     
 Transaction  Account data structure  Withdraw
     Deposite
     Balance
     Transfer
 Printer  Account data structure PrintWithdraw
   Date  PrintDeposite
     PrintTransfer

2. Design the product in terms of clients of objects is shown as below

 

3. Proceed to the detailed design

 

 Class Name  Printer
 Method Name  PrintWithdraw
 Modifier, Type  public void
 Agrument  Account data structure, Date
 Error message  Printer Error
 Files access  none
 Files changed  none
 Method called  none
 Narrative  Print withdraw slip

 

 Class Name  Printer
 Method Name  PrintDeposite
 Modifier, Type  public void
 Agrument  Account data structure, Date
 Error message  Printer Error
 Files access  none
 Files changed  none
 Method called  none
 Narrative  Print deposite slip

 Class Name  Printer
 Method Name  PrintTransfer
 Modifier, Type  public void
 Agrument  Account data structure, Date
 Error message  Printer Error
 Files access  none
 Files changed  none
 Method called  none
 Narrative  Print transfer funds slip

 Class Name  Transaction
 Method Name Withdraw
 Modifier, Type  public boolean
 Agrument  Account data structure
 Error message Error if overdrawn
 Files access  user's account
 Files changed  user's account
 Method called  none
 Narrative performs withdraw from user's account

 Class Name  Transaction
 Method Name Deposite
 Modifier, Type  public boolean
 Agrument  Account data structure
 Error message error if update can not exist
 Files access  user's account
 Files changed  user's account
 Method called  none
 Narrative  performs update ba;lance in user's account

 Class Name  Transaction
 Method Name  Balance
 Modifier, Type  public boolean
 Agrument  Account data structure
 Error message error in case of can not get user's account
 Files access  user's account
 Files changed  none
 Method called  none
 Narrative  Show user's account balance on monitor

 Class Name  Transaction
 Method Name  Transfer
 Modifier, Type  public boolean
 Agrument  Account data structure of user, Account data structure of transfer account
 Error message  error in case of failed transaction
 Files access user's account and transfered's account
 Files changed  user's account and transfered's account
 Method called  none
 Narrative  performs transfer funds between two accounts

 Class Name  ATM
 Method Name  GetPIN
 Modifier, Type  public String
 Agrument  none
 Error message error if null string
 Files access  none
 Files changed  none
 Method called  none
 Narrative  get PIN number from keypad

 Class Name  ATM
 Method Name  VerifyPIN
 Modifier, Type  public booleam
 Agrument  user's pin as string
 Error message  error if no card in slot
 Files access  none
 Files changed  none
 Method called  none
 Narrative  verify PIN number on card and user's enter on keypad

 Class Name  ATM
 Method Name  Quit
 Modifier, Type  public void
 Agrument none
 Error message  error if card in slot
 Files access  none
 Files changed  none
 Method called  none
 Narrative  eject card from slot

Remark: main function sitted in ATM class wich call instantaneous of transaction class if PIN number are correct. In case of incorrect PIN , the software call quit method to eject card.