-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathAccount.py
36 lines (25 loc) · 918 Bytes
/
Account.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
28
29
30
31
32
33
34
35
class Account:
def __init__(self,id=0,balance=100,annualIntersetRate=0):
self.__id = id
self.__balance = balance
self.__annualIntersetRate = annualIntersetRate
def getId(self):
return self.__id
def getBalance(self):
return self.__balance
def getAnnualIntersetRate(self):
return self.__annualIntersetRate
def setId(self,id):
self.__id = id
def setBalance(self,balance):
self.__balance = balance
def setAnnualIntersetRate(self,annualIntersetRate):
self.__annualIntersetRate = annualIntersetRate
def getMonthlyInterestRate(self):
return (self.__annualIntersetRate/ 12) /100
def getMonthlyInterest(self):
return self.__balance *self.getMonthlyInterestRate()
def deposit(self,balance):
self.__balance += balance
def withdraw(self,amount):
self.__balance -= amount