-
Notifications
You must be signed in to change notification settings - Fork 0
/
transactionManager.py
27 lines (23 loc) · 1015 Bytes
/
transactionManager.py
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
class Account:
def __init__(self, name = "Valued customer", balance = 0, credit = 0, debit = 0, transactionNum = 0):
self._name = name
self._balance = balance
self._credit = credit
self._debit = debit
self._transactions = transactionNum
def credit(self, amount):
self._balance += amount
self._transactions += 1
print("*** Hello %s, $%.2f has been CREDITED to your account" %(self._name, amount))
print("Transation number: %d\n" %self._transactions)
return
def debit(self, amount):
self._balance -= amount
self._transactions += 1
print("*** Hello, %s, $%.2f has been DEBITED to your account" % (self._name, amount))
print("** $%.2f has been debited to your account" % amount)
print("Transation number: %d\n" % self._transactions)
return
def checkBalance(self):
print("## Dear %s, Your account balance is $%.2f ##\n" %(self._name,self._balance))
return