-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatmdemo.py
More file actions
30 lines (28 loc) · 1.1 KB
/
atmdemo.py
File metadata and controls
30 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'''
Author:Irene Jimmy
Date:28-10-2024
Description:a program that simulates a simple bank ATM system. The user has an initial balance of $1000. The ATM should display a menu with options to:Check Balance Deposit Money Withdraw Money Exit
'''
balance_amount=1000
while True:
print("\n1.\tCheck Balance")
print("2.\tDeposit Money")
print("3.\tWithdraw Money")
print("4.\tExit")
choice=int(input("Enter your choice:"))
if choice==1:
print(f"The current balance ${balance_amount}")
elif choice==2:
deposit_amount=float(input("Enter the amount:"))
balance_amount=balance_amount+deposit_amount
print(f"The deposited amount ${balance_amount} and"f"the current balance ${balance_amount}")
elif choice==3:
withdraw_amount=float(input("Enter the amount to withdraw:"))
if withdraw_amount>balance_amount:
print("Insufficent balance")
else:
print(f"The amount withdrawn from the account "f"${withdraw_amount} the balance amount "f"${balance_amount}")
elif choice==4:
break
else:
print("Invalid Entry")