Advertisement
Maxidooos

BBA ONLINE TEXT BAKCEND

Sep 30th, 2022 (edited)
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.40 KB | Source Code | 0 0
  1. global payee
  2. global bal
  3. global emial
  4. global pta
  5. global sname
  6. global pname
  7. global all
  8.  
  9.  
  10. def c1(): #Call 1
  11.     print("Please enter an ID")
  12.     global ID #Makes the ID variable avaliable globally
  13.     ID=input("ID: ") #aks for an ID
  14.     c2()
  15.  
  16. def c2(): #Call 2
  17.     if ID=="1": #Checks if the entered ID is in the database
  18.         print("Please enter your security code")
  19.         c3()
  20.  
  21. def c3(): #Call 3
  22.     global sc  
  23.     sc=input("Secure Keyboard: ")
  24.     scc()
  25.  
  26. def scc(): #Security Code Check
  27.     if sc=="1":
  28.         print("Welcome to BBA backend")
  29.         upp()
  30.  
  31. def upp(): #User profile protocol
  32.     global fname   
  33.     fname="Kevin" #forename/first name
  34.     global sname   
  35.     sname=" Dontenville" #surname
  36.     global bal  
  37.     bal=int(10000) #balance
  38.     global email   
  39.     email="Kevin@keepnet.net" #Email address
  40.     global pnum
  41.     pnum="01568 77002" #Phone number
  42.     global cor 
  43.     cor="UK" #country of residence
  44.     func()
  45.  
  46. def func():
  47.     print("Please select a function by entering a number:")
  48.     print("| 1 - Balance")
  49.     print("| 2 - Transfer")
  50.     print("| 3 - Loans    ")
  51.     print("| 4 - Log out ")
  52.     print("| 5 - Register")
  53.     global fcs 
  54.     fcs=input("Function: ") #fcs=func select
  55.     fci() #Function input call
  56.  
  57. def fci():
  58.     if fcs=="1":
  59.         bala()
  60.     else:
  61.         if fcs=="2":
  62.             transf()
  63.         else:
  64.             if fcs=="3":
  65.                 loans()
  66.             else:
  67.                 if fcs=="4":
  68.                     os()
  69.                 else:
  70.                     if fcs=="5":   
  71.                         register()
  72.                     else:
  73.                         print("Unrecognised Function")                 
  74.                         func()
  75.  
  76. def bala():
  77.     print("---------------------------------------------------------------------------")
  78.     print("| Your current balance is (GBP):",bal)
  79.     print("| Balance incl pending is (GBP):",bal)
  80.     print("---------------------------------------------------------------------------")
  81.     func()
  82.    
  83. def transf():
  84.     print("To transfer please enter a PID")
  85.     global payee
  86.     payee=input("Payee ID: ")
  87.     pn() #payee name
  88.     print("Please wait while we validate your request....")
  89.     print("Validated")
  90.     print("Please enter an amount to transfer in GBP")
  91.     global pta
  92.     global bal 
  93.     pta=int(input("£"))
  94.     if bal<pta:
  95.         print("Insuffienct funds")
  96.         transf()
  97.     else:
  98.         print("You are transfering to",payee)
  99.         print("Please enter your Security pin to continue")
  100.         sc=input("Security Pin: ")
  101.         if sc=="1":    
  102.             bal-=pta
  103.             print("Your new balance is",bal)       
  104.             print("Succesfully Transfered")
  105.             func()
  106.         else:
  107.             print("Incorrect: one more attempt")
  108.             print("Please enter your Security pin to continue")
  109.             sc=input("Security Pin: ")
  110.             if sc=="1":
  111.                 bal-=pta
  112.                 print("Your new balance is",bal)           
  113.                 print("Successfully transfered.")
  114.                 func()     
  115.             else:
  116.                 print("Failed 2 times")
  117.                 transf()
  118.  
  119. def pn():
  120.     global payee
  121.     if payee=="2":
  122.         payee="Max Dontenville"
  123.     else:
  124.         if payee=="3":
  125.             payee="Polly Dontenville"
  126.         else:
  127.             if payee=="4":
  128.                 payee="Heather Dontenville"
  129.             else:
  130.                 print("No such payee.")
  131.                 transf()
  132.  
  133. def loans():
  134.     print("Checking if you are eligible for a loan...")
  135.     lmin=int(8999) 
  136.     if bal>lmin:
  137.         loanfunc()
  138.     else:
  139.         print("Error: You need £9,000 for loan eligibility!")
  140.         func()
  141. def loanfunc():
  142.     global bal 
  143.     print("| - Loaning - |")
  144.     print("- Intrest rates of 16.7% [Bank of england mininum]")
  145.     print("- Up to Triple Your current balance.")
  146.     print("- Annual Payments")
  147.     print("| - - - - - - |")
  148.     print("")
  149.     print("You can have up to:")
  150.     if bal>10000:
  151.         print(bal*2)
  152.     elif bal>150000:
  153.         print(bal*3)
  154.    
  155.     print("Please enter an amount you would like to withdraw in GBP:")
  156.     loana=int(input("£")) #loana=loan amt
  157.     print("You would like to withdraw",loana)
  158.     if loana>bal*2:
  159.         print("")
  160.         print("")      
  161.         print(" -!!- You cant withdraw more than double your balance -!!- ")
  162.         print("")
  163.         print("")
  164.         loanfunc()             
  165.     elif loana<bal*2:
  166.         print("Accepted value.")
  167.         if loana>20000:
  168.             print("You have until 6/10/25 to repay this loan")
  169.         elif loana<15000:
  170.             print("You have until 6/11/23 to repay this loan")
  171.        
  172.         print("To complete this loan please anter your security code:")
  173.         sc=input("Security Pin: ")
  174.         if sc=="1":    
  175.             bal+=loana
  176.             print("Your new balance is",bal)   
  177.             func()
  178.         else:
  179.             print("Incorrect code 1/2 attempts")
  180.             print("To complete this loan please anter your security code:")
  181.             sc=input("Security Pin: ")
  182.             if sc=="1":
  183.                 bal+=loana
  184.                 print("Your new balance is",bal)   
  185.                 func()
  186.             else:
  187.                 print("Incorrect code 2/2 attempts")
  188.                 func()
  189. def os(): #open system
  190.     print("Welcome to the official backend for the British Banking Association")
  191.     c1()
  192.  
  193. def register():
  194.     print("Thanks for considering registering with BBA.")
  195.     print("Please carefully follow the instructions below")
  196.     print("Please add your country of residence (e.g. `UK`):")
  197.     global country 
  198.     country=input("Country: ")
  199.     print("Please enter your name: ")
  200.     global fname   
  201.     fname=input("First name: ")
  202.     global sname   
  203.     sname=input("Surname: ")
  204.     print("Please enter your phone number:")
  205.     global pnum
  206.     pnum=int(input("Phone number: "))
  207.     print("Please enter your email address:")
  208.     global email   
  209.     email=input("Email address: ")
  210.     print("Thankyou for registering with BBA")
  211.     print("Registered information:")
  212.     print("Country -",country)
  213.     print("Full name -",fname +" "+sname)
  214.     print("Phone Number -",pnum)
  215.     print("Email -",email)
  216.     print("Thanks for joining the British Banking Association.")
  217.     print("Your personal ID is '10'")
  218.     print("Your security code is '18596'")
  219.     func()
  220.  
  221. print("Welcome to the official backend for the British Banking Association")
  222. c1()
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement