Skip to content

Commit 5e24f87

Browse files
committed
deposit menu
1 parent 53804dd commit 5e24f87

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lab-11/atm.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ def main_menu(id):
3030
selection = int(input("Enter your selection here: "))
3131
if (selection == 1):
3232
print(eval(f"account_{id}.get_balance()"))
33-
else if(selection == 2):
33+
get_id()
34+
else if (selection == 2):
3435
withdraw_amount = float(prompt("Enter the amount of money you would like to withdraw: "))
3536
eval(f"account_{id}.withdraw({withdraw_amount})")
36-
print(f"${withdraw_amount} was withdrawed successfully")
37-
38-
37+
print(f"${withdraw_amount} was withdrawed successfully\nYour new balance is {account_{id}.get_balance()}")
38+
get_id()
39+
else if (selection == 3):
40+
deposit_amount = float(prompt("Enter the amount of money you would like to deposit: "))
41+
eval(f"account_{id}.deposit({deposit_amount})")
42+
print(f"${deposit_amount} was deposited successfully\nYour new balance is {account_{id}.get_balance()}")
43+
get_id()
3944

4045
get_id()

0 commit comments

Comments
 (0)