Advertisement
viligen

Bank of Mario

Sep 7th, 2021
1,326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.68 KB | None | 0 0
  1. # ------------------------->>>>>>>> SoftUni Python BANK <<<<<<<<<------------------------------
  2. # ------------------------->>>>>>>> SoftUni STUDENTS 2021 <<<<<<<<<----------------------------
  3.  
  4. # ------------------> ЛИСТ КОНСТРУКЦИЯ - научи повече --->  https://www.w3schools.com/python/python_lists.asp
  5. NamesOFClients = ['Plamen Yordanov', 'Ivan Ivanov', 'Iva Georgieva', 'Maria Ivanova', 'Nikol Nedyalkova', 'Borislav Topalov', 'Cvetelina Borislavova']
  6. ClientPins = ['0001', '0002', '0003', '0004', '0005', '0006', '0007']
  7. ClientBalances = [10000, 20000, 30000, 40000, 50000, 60000, 70000]
  8. CreditCards = []
  9. Clnts_Overdrafts = [0, 2000, 0, 3000, 500, 0, 1000]
  10. ClientDeposition = 0
  11. ClientWithdrawal = 0
  12. ClientBalance = 0
  13. disk1 = 1
  14. disk2 = 7
  15. u = 0
  16. while True:
  17.     # os.system("cls")
  18.     print("************************************************************")
  19.     print("========== WELCOME TO SoftUni PYTHON BANKING SYSTEM ========")
  20.     print("************************************************************")
  21.     print("==========     (a). Open New Client Account     ============")
  22.     print("==========     (b). The Client Withdraw a Money ============")
  23.     print("==========     (c). The Client Deposit a Money  ============")
  24.     print("==========     (d). Check Clients & Balance     ============")
  25.     # ---------------- ПРИМЕРЕН ВХОД -------------------------
  26.     # print("==========     (f). Check For Credit Card       ============")
  27.     print("==========     (f). Check for Overdraft Balance ============")
  28.     print("==========     (e). Quit                        ============")
  29.     print("************************************************************")
  30.  
  31.     EnterLetter = input("Select a Letter from the Above Box menu : ")
  32.     if EnterLetter == "a":
  33.         print(" Letter a is Selected by the Client")
  34.         NumberOfClient = eval(input("Number of Clients : "))
  35.         u = u + NumberOfClient
  36.  
  37.         if u > 7:
  38.             print("\n")
  39.             print("Client registration exceed reached or Client registration too low")
  40.             u = u - NumberOfClient
  41.         else:
  42.             while disk1 <= u:
  43.                 name = input("Write Your Fullname : ")
  44.                 NamesOFClients.append(name)
  45.                 pin = str(input("Please Write a Pin to Secure your Account : "))
  46.                 ClientPins.append(pin)
  47.                 ClientBalance = 0
  48.                 ClientDeposition = eval(input("Please Insert a Money to Deposit to Start an Account : "))
  49.                 ClientBalance = ClientBalance + ClientDeposition
  50.                 ClientBalances.append(ClientBalance)
  51.                 print("\nName=", end=" ")
  52.                 print(NamesOFClients[disk2])
  53.                 print("Pin=", end=" ")
  54.                 print(ClientPins[disk2])
  55.                 print("Balance=", "P", end=" ")
  56.                 print(ClientBalances[disk2], end=" ")
  57.                 disk1 = disk1 + 1
  58.                 disk2 = disk2 + 1
  59.                 print("\nYour name is added to Client Table")
  60.                 print("Your pin is added to Client Table")
  61.                 print("Your balance is added to Client Table")
  62.                 print("----New Client account created successfully !----")
  63.                 print("\n")
  64.                 print("Your Name is Available on the Client list now : ")
  65.                 print(NamesOFClients)
  66.                 print("\n")
  67.                 print("Note! Please remember the Name and Pin")
  68.                 print("========================================")
  69.  
  70.         mainMenu = input(" Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_")
  71.     elif EnterLetter == "b":
  72.         v = 0
  73.         print(" letter b is Selected by the Client")
  74.         while v < 1:
  75.             w = -1
  76.             name = input("Please Insert a name : ")
  77.             pin = input("Please Insert a pin : ")
  78.             while w < len(NamesOFClients) - 1:
  79.                 w = w + 1
  80.                 if name == NamesOFClients[w]:
  81.                     if pin == ClientPins[w]:
  82.                         v = v + 1
  83.                         print("Your Current Balance:", "P", end=" ")
  84.                         print(ClientBalances[w], end=" ")
  85.                         print("\n")
  86.                         ClientBalance = (ClientBalances[w])
  87.                         ClientWithdrawal = eval(input("Insert value to Withdraw : "))
  88.                         if ClientWithdrawal > ClientBalance:
  89.                             deposition = eval(input(
  90.                                 "Please Deposit a higher Value because your Balance mentioned above is not enough : "))
  91.                             ClientBalance = ClientBalance + deposition
  92.                             print("Your Current Balance:", "P", end=" ")
  93.                             print(ClientBalance, end=" ")
  94.                             ClientBalance = ClientBalance - ClientWithdrawal
  95.                             print("-\n")
  96.                             print("----Withdraw Successfully!----")
  97.                             ClientBalances[w] = ClientBalance
  98.                             print("Your New Balance: ", "P", ClientBalance, end=" ")
  99.                             print("\n\n")
  100.                         else:
  101.                             ClientBalance = ClientBalance - ClientWithdrawal
  102.                             print("\n")
  103.                             print("----Withdraw Successfully!----")
  104.                             ClientBalances[w] = ClientBalance
  105.                             print("Your New Balance: ", "P", ClientBalance, end=" ")
  106.                             print("\n")
  107.             if v < 1:
  108.                 print("Your name and pin does not match!\n")
  109.                 break
  110.         mainMenu = input(" Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_")
  111.     elif EnterLetter == "c":
  112.         print("Letter c is selected by the Client")
  113.         x = 0
  114.         while x < 1:
  115.             w = -1
  116.             name = input("Please Insert a name : ")
  117.             pin = input("Please Insert a pin : ")
  118.             while w < len(NamesOFClients) - 1:
  119.                 w = w + 1
  120.                 if name == NamesOFClients[w]:
  121.                     if pin == ClientPins[w]:
  122.                         x = x + 1
  123.                         print("Your Current Balance: ", "P", end=" ")
  124.                         print(ClientBalances[w], end=" ")
  125.                         ClientBalance = (ClientBalances[w])
  126.                         print("\n")
  127.                         ClientDeposition = eval(input("Enter the value you want to deposit : "))
  128.                         ClientBalance = ClientBalance + ClientDeposition
  129.                         ClientBalances[w] = ClientBalance
  130.                         print("\n")
  131.                         print("----Deposition successful!----")
  132.                         print("Your New Balance: ", "P", ClientBalance, end=" ")
  133.                         print("\n")
  134.             if x < 1:
  135.                 print("Your name and pin does not match!\n")
  136.                 break
  137.         mainMenu = input(" Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_")
  138.     elif EnterLetter == "d":
  139.         print("Letter d is selected by the Client")
  140.         w = 0
  141.         print("Client name list and balances mentioned below : ")
  142.         print("\n")
  143.         while w <= len(NamesOFClients) - 1:
  144.             print("->.Customer =", NamesOFClients[w])
  145.             print("->.Balance =", "P", ClientBalances[w], end=" ")
  146.  
  147.             print("\n")
  148.             w = w + 1
  149.         mainMenu = input(" Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_ ")
  150.     elif EnterLetter == "e":
  151.         print("letter e is selected by the client")
  152.         print("Thank you for using our banking system!")
  153.         print("\n")
  154.         print("Thank You and Come again")
  155.         print("God Bless You!")
  156.         break
  157.     # !!!!!!!!!!!!!!! ПРИМЕРНА ПРОВЕРКА !!!!!!!!!!!!!!!!!
  158.     elif EnterLetter == "f":
  159.         print("\nLetter (f) has been selected \n")
  160.         name = input("Please Insert a name : ")
  161.         if name in NamesOFClients:
  162.             print('The available Overdraft amount is: ', end="")
  163.             for f in range(len(NamesOFClients)):
  164.                 if name == NamesOFClients[f]:
  165.                     print(Clnts_Overdrafts[f], "\n")
  166.         else:
  167.             print("Your name does not exist in our system!\n")
  168.         mainMenu = input("Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_")
  169.     else:
  170.         print("Invalid option selected by the Client")
  171.         print("Please Try again!")
  172.  
  173.         mainMenu = input("Press Enter Key to go Back to Main Menu to Conduct Another Transaction or Quit_")
  174.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement