Pseudocode For DGR Bank ATM

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Dave Gabriel P.

Rualo Computer Programming 1


BSIT-1F Ms. Leyba
201811518
 Pseudocode for DGR Bank ATM
STEP 1: Start
STEP 2: print(“DGR Bank ATM“)
STEP 3: print(“Please insert your ATM Card”)
STEP 4: Set the variable for balance which is 506.50, bal = float(506.50).
STEP 5: Set the variable for PIN Code, pin = int(input(“Enter your PIN Code: “)).
STEP 6: To set the exact value for PIN Code use the statement, if pin == 1234:
STEP 7: If user input the PIN Code correctly, print(“PIN Code is correct”)
STEP 8: If the PIN Code inputted by the user is wrong, print(“Incorrect PIN Code” ,
“\nTransaction is terminated”)
STEP 9: To create a loop for the Menu in case the user wants to make another
transaction, use while True: statement.
STEP 10: Make a welcome sign, print(“!-Welcome to DGR Bank-!”).
STEP 11: Make the MENU sign, print(“-MENU-”).
STEP 12: If user wants to check balance, print(“Press ‘1’ to check your account balance“).
STEP 13: If user wants to withdraw, print(“Press ‘2’ to withdraw amount from your
account”).
STEP 14: If user wants to make a deposit, print(“Press ‘3’ to make a deposit to your
account”).
STEP 15: If user wants to exit the transaction and retrieve his ATM Card, print(“Press ‘4’ to
quit and the machine will return your ATM Card“).
STEP 16: This is the variable where the user will input a number corresponding on which
Menu option the user will use, menu = int(input(“What function would you like to use?
Press the corresponding number : ”).
STEP 17: If the user inputted number 1, use if condition. if menu == 1:
STEP 18: print(“Your remaining balance is”, bal)
STEP 19: To make a loop in case the user wants to make another transaction, use while
True:
STEP 20: Set a variable to make a message prompt for user to choose if user wants to go
back to main menu. prompt1 = str(input(“Would you like to go back on the main menu?
Y/N : ”)
STEP 21: Use break to end the loop on Step 19,
STEP 22: If the user inputted “Y” or “y”, user will go back to main menu. Use if prompt1
== “Y” or “y” :
STEP 23: Use continue for the program to be able to enter the Main Menu’s loop.
STEP 24: If user inputted “N” or “n”, the transaction ends. Use elif prompt1 == “N” or
prompt 1 == “n” :
STEP 25: print(“Thanks for using DGR Bank ATM”,”\nTransaction is terminated”)
STEP 26: Use break to end the loop.
STEP 27: If user inputted another value aside from the declared on step 22,24.
print(“Invalid Input”).
STEP 28: Use break to end the loop.
STEP 29: If the user inputted number 3, use elif == 3:
Dave Gabriel P. Rualo Computer Programming 1
BSIT-1F Ms. Leyba
201811518
Dave Gabriel P. Rualo Computer Programming 1
BSIT-1F Ms. Leyba
201811518
STEP 30: print(“Your remaining balance is”, bal).
STEP 31: set variable for withdrawed amount, wdraw = float(input(“How much would you
like to withdraw? :”)
STEP 32: set the operation to check how much remains on the account after the
withdrawal of amount, wtotal = float(bal) – float(wdraw)
STEP 33: to create a loop on option 2: use while True:
STEP 34: if the user withdraw amount which is greater than his remaining balance, use
wdraw > bal :
STEP 35: print(“Insufficient Balance”)
STEP 36: User break to end the loop.
STEP 37: If the user withdraw amount that is less than or equal from his remaining
balance, use elif wdraw <= bal:
STEP 38: print(“Amount withdrawed successfully”, “\nYour total balance is :” , wtotal).
STEP 39: Use break to end the loop.
STEP 40: If the user wants to go back on the main menu from option 2 create a loop, use
while True:
STEP 41: Set the prompt message, prompt2 = str(input( “Would you like to go back on the
main menu? Y/N : “))
STEP 42: Use break to end the loop
STEP 43: If user inputted Y or y, use if prompt2 == “Y” or prompt2 == “y”:
STEP 44: Use continue to enter loop for main menu.
STEP 45: If the user inputted N or n, user elif prompt2 == “N” or prompt2 == “n”:
STEP 46: print(“Thank you for using DRG Bank ATM” , “\nTransaction is terminated”)
STEP 47: Use break to end the loop.
STEP 48: If the user inputted different data, use else:
STEP 49: print(“Invalid Input”)
STEP 50: Use break to end the loop.
STEP 51: If the user inputted number 3, use elif menu == 3:
STEP 52: print(“Your remaining balance is” , bal).
STEP 53: set the variable for the deposit, dposit = float(input(“How much would you like
to deposit? :”).
STEP 54: Set the operation to check how much is the balance after the deposit, dtotal =
float(bal) + float(dposit).
STEP 55: print(“Deposit is successful”, “\nYour total balance is :”, dtotal)
STEP 56: if user wants to go back on the main menu. Create a loop, use while True:
STEP 57: Set the prompt message, prompt3 = str(input(“Would you like to go back on the
main menu? Y/N : “))
STEP 58: Use break to end the loop.
STEP 59: If the user inputted Y or y, use if prompt3 == “Y” or prompt3 == “y”:
STEP 60: Use continue to enter the loop of Main menu.
STEP 61: If the user inputted N or n, use elif prompt3 == “N” or prompt3 == “n”:
STEP 62: print(“Thank you for using DGR Bank ATM” , ”\nTransaction is terminated”)
STEP 63: if the user inputted different data, use else:
Dave Gabriel P. Rualo Computer Programming 1
BSIT-1F Ms. Leyba
201811518
STEP 64: print(“Invalid Input”)
STEP 65: Use break to end the loop.
STEP 66: If user inputted number 4, use elif == 4:
STEP 67: Print(“thank you for using DGR Bank ATM” , “\nPlease retrieve your card”)
STEP 68: To make the exit function, Use the command: import sys
STEP 69: Use sys.exit(0) to exit the program.
STEP 70: Finish.

You might also like