<reponame>404nofound/CS521-Info-Str-Python<gh_stars>0
from account import Account

class atm(Account):
    def __init__(self, id):
        super().__init__()
        self.__id = id

    def show_menu(self):
        print ("\nMain menu\n1: check balance\n2: withdraw\n3: deposit\n4: exit")

def main():

    again = True
    next = True

    while again:
        id = eval(input("Enter an account id: "))
        if id in range(0,10):
            again = False
        else:
            print ("Please enter a correct id")

    ATM = atm(id)

    while next:
        ATM.show_menu()
        choice = eval(input("Enter a choice: "))

        if choice == 1:
            print ("The balance is ", ATM.get_balance())
        elif choice == 2:
            wit = eval(input("Enter an amount to withdraw: "))
            ATM.withdraw(wit)
        elif choice == 3:
            dep = eval(input("Enter an amount to deposit: "))
            ATM.deposit(dep)
        elif choice == 4:
            print ("")
            next = False
            main()

if __name__ == '__main__':
    main()

from account import Account

class atm(Account):
    def __init__(self, id):
        super().__init__()
        self.__id = id

    def show_menu(self):
        print ("\nMain menu\n1: check balance\n2: withdraw\n3: deposit\n4: exit")

def main():

    again = True
    next = True

    while again:
        id = eval(input("Enter an account id: "))
        if id in range(0,10):
            again = False
        else:
            print ("Please enter a correct id")

    ATM = atm(id)

    while next:
        ATM.show_menu()
        choice = eval(input("Enter a choice: "))

        if choice == 1:
            print ("The balance is ", ATM.get_balance())
        elif choice == 2:
            wit = eval(input("Enter an amount to withdraw: "))
            ATM.withdraw(wit)
        elif choice == 3:
            dep = eval(input("Enter an amount to deposit: "))
            ATM.deposit(dep)
        elif choice == 4:
            print ("")
            next = False
            main()

if __name__ == '__main__':
    main()