Skip to content

Instantly share code, notes, and snippets.

@srph
Created September 8, 2014 14:50
Show Gist options
  • Select an option

  • Save srph/e9251dceb2915c21f65c to your computer and use it in GitHub Desktop.

Select an option

Save srph/e9251dceb2915c21f65c to your computer and use it in GitHub Desktop.
Banking (COBOL)
Algo
1. Welcoming Screen
- press any key to continue
2. next screen with 2 options :
- if the user has already an account
- if the user hasn't got yet an account
2.a. if the user hasn't got yet an account
- proceed to registration
- return to 2.a.i
2.a.i. get the following information from the user :
- account name
- account number / pin code
___________________________
- check if the entered information/s is already in the DAT file
- if yes
- display " Entered information already exist "
- return to 2.a.
- else
- record the date in the DAT file
2.b. if the user has already an account
1. proceed to entering of account name
2. return to 2
2.b.i. get account name
- check if account name exist
- if doesn't exist
- attempt-name + 1
- if attempt-name = 3
- terminate program
- if does exist
- continue
2.b.ii. next screen with 5 options
A. withdraw
B. Deposit
C. Check current balance
D. check conversion rates
E. exit
2.b.ii.A. accept amount to be withdrawed
- check if balance is greater than withdrawed amount
- if yes
- compute for balance
- continue
- if no
- display "Not enough funds"
- return to 2.b.ii.A.
- ask user if he/she wants the money to be converted to other currency
- if yes
- convert + 1
- accept currency
- compute converted amount
- continue
* accept account number / pin code
- check if account number / pin code exist
- if doesn't exist
- attempt-code + 1
- if attempt-code = 3
- terminate program
- else
- return to *
- if does exist
- record withdrawed amount and balance in the file of the user
- display withdrawed amount
- if convert is equal to 1
- display converted amount
- return to 2.b.ii.
2.b.ii.B. accept currency
- compute deposited/converted amount
- compute balance
* accept account number / pin code
- check if account number / pin code exist
- if doesn't exist
- attempt-code + 1
- if attempt-code = 3
- terminate program
- else
- return to *
- if does exist
- record deposited amount and balance in the file of the user
- display deposited/converted amount
- return to 2.b.ii.
2.b.ii.C. display balance
- press any key to continue
2.b.ii.D. display conversion rates
- press any key to continue
2.b.ii.E. Thank you screen
- terminate program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment