# Arup Guha
# 6/9/2023
# Example of a Menu Driven Program - Bank

# Get initial money.
money = int(input("How much money are you starting your account with?\n"))

# Print options read in user choice.
print("1. Deposit Money.")
print("2. Withdraw Money.")
print("3. Print Balance.")
print("4. Quit.")
choice = int(input("What selection would you like to make?\n"))

# Keep going until user quits.
while choice != 4:

    # Process a deposit.
    if choice == 1:
        add = int(input("How much are you depositing?\n"))

        # Only add if positive.
        if add > 0:
            money += add
            print("Great we've deposited",add,"dollars.")
        else:
            print("No action was taken negative deposits not allowed.")

    # Process a withdrawal.
    elif choice == 2:

        # Get withdrawal
        sub = int(input("How much are you withdrawing?\n"))

        # Skip over two invalid cases.
        if sub < 0:
            print("Can't do a negative withdrawal.")
        elif sub > money:
            print("Sorry, you don't have that much money!")

        # Process regular withdrawal.
        else:
            money -= sub
            print("Great, here's your money:",sub,"dollars.")

    # Print balance option
    elif choice == 3:
        print("You currently have",money,"dollars.")

    # Catch invalid choice.
    elif choice != 4:
        print("Sorry, that was an invalid option.")

    # Print options read in user choice.
    print("1. Deposit Money.")
    print("2. Withdraw Money.")
    print("3. Print Balance.")
    print("4. Quit.")
    choice = int(input("What selection would you like to make?\n"))

# Print final message.
print("Thanks for banking with us. You have",money,"dollars now.")

            