Skip to content

Commit 11df92d

Browse files
committed
submitting for review
1 parent 62c55fb commit 11df92d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

code/Andy/python/andy_lab10_atm_v1.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def check_balance(self): # going into self to retrieve balance from what you hav
1515
def deposit(self, amount):
1616
self.balance += amount
1717
self.transactions.append(f'user deposited {amount}')
18-
18+
return self.balance
1919

2020
def check_withdrawal(self, amount): #using self to get balance and amount since thats what we're checking
2121
if self.balance >= amount:
@@ -26,13 +26,16 @@ def check_withdrawal(self, amount): #using self to get balance and amount since
2626
def withdraw(self, amount):
2727
self.balance -= amount
2828
self.transactions.append(f'user withdrew {amount}')
29-
29+
return self.balance
30+
3031
def calc_interest(self):
3132
interest = self.balance * self.intrest_rate * .01
3233
return interest
3334

3435
def print_transactions(self):
35-
print(self.transactions)
36+
for i in self.transactions:
37+
print(i)
38+
return self.transactions
3639

3740

3841
# atm = ATM(5, .001) #putting the values for the initializer.its an object
@@ -68,7 +71,8 @@ def print_transactions(self):
6871
atm.deposit(amount)
6972
print(f'Accumulated ${amount} in interest')
7073
elif command == "transactions":
71-
atm.print_transactions()
74+
transactions = atm.print_transactions()
75+
print(f'your transaction history is {transactions}')
7276
elif command == 'help':
7377
print('Available commands:')
7478
print('balance - get the current balance')

0 commit comments

Comments
 (0)