Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Philip-Python-Lab14_ATM Updated to not allow negative deposits #314

Merged
merged 2 commits into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Code/Philip/Python/Lab14_ATM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''ATM Lab14
By Philip Bartoo
10/25/21
Updated 1/16/22
'''

class ATM:
Expand All @@ -12,8 +13,11 @@ def check_balance(self):
return self.balance

def deposit(self, amount):
self.balance += amount
return self.balance
if amount < 0:
return print("Not Allowed")
else:
self.balance += amount
return self.balance

def check_withdrawal(self, amount):
if self.balance - amount > 0:
Expand Down Expand Up @@ -80,5 +84,4 @@ def calc_interest(self):
break

else:
print('Command not recognized')

print('Command not recognized')