Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ATM MACHINE'S PSEUDO CODE (CHECK BALANCE, WITHDRAW, AND EJECT CARD OPTION)
- BY: JOHN KAISER G. LLARVES
- VARIABLES:
- CARD
- CHOICESCREEN
- CURRENTBALANCE
- NEWBALANCE
- WITHDRAWAMOUNT
- BALANCE
- BALCHOICE
- NEWBALCHOICE
- EXITNEWBAL
- EXITINSUFFBAL
- BEGIN
- WHILE MAIN MENU:
- SHOW PLEASE INSERT CARD
- INPUT: INSERT CARD
- PROCESS: READ CARD AND FIND DATABASE
- IF CARD VALID
- {
- INPUT: PLEASE ENTER PIN
- IF PIN IS VALID
- {
- INPUT: WHAT WOULD YOU LIKE TO DO?: \n1. Check Balance\n2. Withdraw\n3. Eject Card
- IF CHOICE == 1
- {
- OUTPUT: REMAINING BALANCE: CURRENTBALANCE \nWHAT WOULD YOU LIKE TO DO?\n1. Return\n2. Withdraw Balance
- IF BALCHOICE == 1
- {
- CHOICESCREEN
- }
- ELSE IF BALCHOICE == 2
- {
- LESSEN THE BALANCE AND DISPLAY CURRENTBALANCE
- DISPLAY WHAT WOULD YOU LIKE TO DO? \n1. Return\nEject Card
- IF NEWBALCHOICE == 1
- {
- CHOICESCREEN
- }
- ELSE IF CHOICE == 2
- {
- EJECT CARD
- ENDIF
- }
- ELSE
- {
- DISPLAY: Please Choose a valid number!
- }
- ENDIF
- ELSE
- {
- DISPLAY PLEASE CHOOSE A VALID OPTION!
- }
- }
- ENDIF
- }
- ELSE IF CHOICE == 2
- {
- DISPLAY CURRENTBALANCE \nWHAT WOULD YOU LIKE TO DO?
- INPUT AMOUNT TO WITHDRAWAMOUNT
- CHECK DATABASE IF BALANCE IS SUFFICIENT
- IF CURRENTBALANCE >= WITHDRAW AMOUNT
- {
- YOU HAVE SUCCESSFULLY WITHDREW {WITHDRAW AMOUNT}, YOUR NEW BALANCE IS: {NEW BALANCE}
- WHAT WOULD YOU LIKE TO DO? \n1. Return\n2. Eject Card
- IF EXITNEWBAL == 1
- {
- CHOICESCREEN
- }
- ELSE IF EXITNEWBAL == 2
- {
- EJECT CARD
- }
- ELSE
- {
- DISPLAY PLEASE SELECT A VALID OPTION!
- }
- ENDIF
- }
- ELSE IF CURRENTBALANCE < WITHDRAWAMOUNT
- {
- DISPLAY SORRY YOU HAVE INSUFFICIENT FUNDS
- WHAT WOULD YOU LIKE TO DO? \n1. Return\n2. Eject Card
- IF EXITINSUFFBAL == 1
- {
- CHOICESCREEN
- }
- ELSE IF EXITINSUFFBAL == 2
- {
- EJECT CARD
- }
- ENDIF
- }
- ELSE
- {
- DISPLAY PLEASE CHOOSE A VALID OPTION!
- }
- ENDIF
- }
- ELSE IF CHOICE == 3
- {
- EJECT CARD
- }
- ELSE IF PIN IS NOT VALID USER IS GIVEN 4 MORE TRIES
- IF USER DOES NOT PASS THE AUTHENTICATION PROCESS
- {
- DISPLAY PLEASE TRY AGAIN IN 24HRS
- GO BACK TO MAIN MENU
- }
- ENDIF
- }
- ELSE
- OUTPUT: PLEASE TRY ANOTHER CARD AND TRY AGAIN
- MAIN MENU
- ENDIF
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement