def main(): view = View() atm = Atm() view.admin_view() if view.adminlogin() == -1: return -1 print("登陆成功.........") time.sleep(2) while 1: view.guest_view() option = input("请选择您的操作:") if option == "1": atm.creatUser() elif option == "2": atm.searchInfo() elif option == "3": atm.withdrawal() elif option == "4": atm.deposit() elif option == "5": atm.transferAccounts() elif option == "6": atm.changePassword() elif option == "7": atm.lockUser() elif option == "8": atm.unlockUser() elif option == "9": atm.makeANewCard() elif option == "0": atm.closeUser() elif option == "q" or option == "Q": if view.adminlogin() == "a": print("系统正在退出中....") time.sleep(2) break elif option == "a" or option == "A": if view.adminlogin() == -1: pass
from atm import Atm #=================================Version 2==================================== # Have the ATM maintain a list of transactions. Every time the user makes a deposit or withdrawal, add a string to a list saying 'user deposited $15' or 'user withdrew $15'. balance = Atm() user_deposit = int(input('how much do you want to deposit?')) balance.deposit(user_deposit) user_withdrawal = int(input('how much do you want to withdraw?')) balance.withdraw(user_withdrawal) balance.print_transactions()
from card import Card ATM = Atm() # CARD = Card() # print(CARD.card_id) while True: ATM.atm_interface() print("Please Enter a number to do the operation: ") operation = str(input()) if operation == "1": ATM.open_account() elif operation == "2": ATM.balance_info() elif operation == "3": ATM.deposit() elif operation == "4": ATM.open_account() elif operation == "5": ATM.open_account() elif operation == "6": ATM.open_account() elif operation == "7": ATM.open_account() elif operation == "8": ATM.open_account()
from atm import Atm #=================================Version 1==================================== #my initial balance. setting the balance variable to the aAtm type var = Atm() #calling the check balance method print(var.check_balance()) #calling the deposit method user_deposit = round(int(input("How much money do you want to depost.\n: $")), 2) var.deposit(user_deposit) #calling the check balance method print(var.check_balance()) #inputting how much money to withdraw, calls the check_withdrawal method, calls the withdraw funtio in the print statement user_withdrawal = round( int(input("How much money do you want to withdraw? \n: $")), 2) var.check_withdrawal(user_withdrawal) print(f"you have ${var.withdraw(user_withdrawal)} remaining in your account") #to determine the interest, i input how many months the account has been open and then call the calc_interest method. time = float(input("How many months has your account been open")) print( f" your total balance including interst earned is {var.calc_interest(time)}" )