forked from sirfaheem/ComputerScienceALevels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccount.py
More file actions
34 lines (25 loc) · 940 Bytes
/
BankAccount.py
File metadata and controls
34 lines (25 loc) · 940 Bytes
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
class Test:
def __init__(self):
self.__test = None
def showDetails(self):
print("this is a test")
class BankAc:
def __init__(self, acNo, title): #constructor
self.__acNo = acNo
self.__accountTitle = title #data member/attribute/field
self.__balance = 0.0
def showDetails(self): #method
print("Account No: ",self.__acNo)
print("Title of A/c: ",self.__accountTitle)
print("Balance: ", self.__balance)
class SavingAc(BankAc, Test):
def __init__(self, no, title, iR):
BankAc.__init__(self, no, title)
self.__interestRate = iR
def showDetails(self):
BankAc.showDetails(self)
#print("Title: ", self.__accountTitle)
print("Interest Rate: ",self.__interestRate)
myAc = SavingAc(3453, "Hadi Khan", 5.6)
myAc2 = BankAc(5584, "SriHari")
myAc.showDetails()