Пример #1
0
import atm

#begins user with starting balance of $100,000
starting_balance = 100000

#creates and object of ATM class
#passes the starting_balance variable to the bal parameter
savings = atm.ATM(starting_balance)

#sets global constants for menu
WITHDRAW = 1
BALANCE = 2
DEPOSIT = 3
QUIT = 4


def main():

    #initializes the users choice to 0
    choice = 0

    while choice != QUIT:
        #gets the users choice
        choice = menu()

        #processes the users choice
        if choice == WITHDRAW:
            withdraw()
        elif choice == BALANCE:
            balance()
        elif choice == DEPOSIT:
Пример #2
0
from interface import hsm, bank, card
import atm
myHSM = hsm.DummyHSM()
myBank = bank.DummyBank()
myCard = card.DummyCard()
myATM = atm.ATM(myBank, myHSM, myCard)
Пример #3
0
import atm

atm_faisal = atm.ATM(1000, "Faisal Bank")
atm_ahly = atm.ATM(2009, "Ahly Bank")

atm_faisal.withdraw(330)
atm_ahly.withdraw(1283)
atm_faisal.withdraw(330)

atm_faisal.show_withdrawals()
atm_ahly.show_withdrawals()
Пример #4
0
import atm

while True:
    answer = 0
    while not answer in [1, 2, 3]:
        os.system('cls')
        try:
            answer = int(
                input('\n1 - Log in\n2 - Create a account\n3 - Exit\n'))
        except:
            pass

    if answer == 1:
        os.system('cls')
        account_number = input('Account number: ')
        link = atm.ATM(account_number)
        if link.account_exist(account_number):
            answer = 0
            while answer != 4:
                answer = 0
                while not answer in [1, 2, 3, 4]:
                    os.system('cls')
                    print('Current balance: $' + link.current_balance())
                    try:
                        answer = int(
                            input(
                                '\n1 - Deposit\n2 - Withdraw\n3 - Add daily interest\n4 - exit\n'
                            ))
                    except:
                        pass
Пример #5
0
import atm
balance1 = 500
balance2 = 1000

atm1 = atm.ATM(balance1, "Smart Bank")
atm2 = atm.ATM(balance2, "Baraka Bank")

atm1.withdraw(277)
atm1.withdraw(800)

atm2.withdraw(100)
atm2.withdraw(2000)
Пример #6
0
# USER-CREATED LIBRARY
import atm

# GLOBALS

root = tkinter.Tk()
root.geometry("500x500")
root.resizable(0, 0)

menu = None
prompt = None

SUBMISSIONS = ("Pin", "Withdrawal", "Deposit", "View")

machine = atm.ATM(atm.globals.accounts)

# arbitrary card; we can't insert a card into our computers
user = atm.card.Card("3906-4680-7735-0330")

# in reality, we'd need to respond to a failure in matching
match = machine.insert_card(user)
if match is None:
    root.destroy()
    raise SystemExit

# END OF GLOBALS


# base class for derivation
class Frame: