1
+ class Atm :
2
+ def __init__ (self , balance , intrest_rate ):
3
+ self .bal = 0
4
+ self .balance = balance
5
+ self .intrest_rate = intrest_rate
6
+
7
+ def check_balance ():
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ # atm = ATM() # create an instance of our class
16
+ # print('Welcome to the ATM')
17
+ # while True:
18
+ # command = input('Enter a command: ')
19
+ # if command == 'balance':
20
+ # balance = atm.check_balance() # call the check_balance() method
21
+ # print(f'Your balance is ${balance}')
22
+ # elif command == 'deposit':
23
+ # amount = float(input('How much would you like to deposit? '))
24
+ # atm.deposit(amount) # call the deposit(amount) method
25
+ # print(f'Deposited ${amount}')
26
+ # elif command == 'withdraw':
27
+ # amount = float(input('How much would you like '))
28
+ # if atm.check_withdrawal(amount): # call the check_withdrawal(amount) method
29
+ # atm.withdraw(amount) # call the withdraw(amount) method
30
+ # print(f'Withdrew ${amount}')
31
+ # else:
32
+ # print('Insufficient funds')
33
+ # elif command == 'interest':
34
+ # amount = atm.calc_interest() # call the calc_interest() method
35
+ # atm.deposit(amount)
36
+ # print(f'Accumulated ${amount} in interest')
37
+ # elif command == 'help':
38
+ # print('Available commands:')
39
+ # print('balance - get the current balance')
40
+ # print('deposit - deposit money')
41
+ # print('withdraw - withdraw money')
42
+ # print('interest - accumulate interest')
43
+ # print('exit - exit the program')
44
+ # elif command == 'exit':
45
+ # break
46
+ # else:
47
+ # print('Command not recognized')
0 commit comments