-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbankaccountmanager.py
More file actions
105 lines (104 loc) · 3.67 KB
/
bankaccountmanager.py
File metadata and controls
105 lines (104 loc) · 3.67 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import sys
import pdb
class Accounts:
def __init__(self,balance):
self.balance=balance
def withdrawel(self,amt):
if amt>balance:
print "withdrawel amount should be less than balance"
elif (balance-amt)<=500:
print"Minimum balance should be 500"
else:
balance=balance-amount
print "withdrawel successful"
def balancecheck():
print "Your current balance is{}".format(balance)
def deposit(amt):
balance+=amt
print "amount deposited successfully"
class BusinessAccount(Accounts):
list1=["kel1","kel2"]
def BusinessWithdraw(name,amt):
if name in list1:
withdrawel(amt)
else:
print "wrong Account Type"
def Businessdeposit(name,amt):
if name in list1:
deposit(amt)
else:
print "wrong Account Type"
class PersonalAccount(Accounts):
list2=["kei1","kei2"]
def PersonalWithdraw(name,amt):
if name in list1:
withdrawel(amt)
else:
print "wrong Account Type"
def Personaldeposit(name,amt):
if name in list1:
deposit(amt)
else:
print "wrong Account Type"
class customer:
def openaccount():
per1=PersonalAccount()
per2=BusinessAccount()
while True:
choice=input("do you want to start an account y/n")
if choice=="yes":
acctype=raw_input("Enter the accocunt type business or personel")
if acctype=="business":
per1.list1.append()
break
elif acctype=="personel":
per2.list2.append()
break
else:
print "provide correct account type"
continue
else:
break
class services:
while True:
print "choose your services"
n=input("1-deposit,2-withdraw 3-exit" )
if n==1:
cusd1=raw_input("Enter customer name")
cusd2=input("enter your amount")
acctype2=raw_input("Enter the accocunt type business or personel")
while True:
if acctype2=="business":
pers1=BusinessAccount(1000)
pers1.BusinessWithdraw(cusd1,cusd2)
break
elif acctype2=="personel":
pers1=PersonalAccount()
pers1.PersonalWithdraw(cusd1,cusd2)
break
else:
print "provide correct accounttype"
continue
elif n==1:
cusd1=raw_input("Enter customer name")
cusd2=input("enter your amount")
acctype2=raw_input("Enter the accocunt type business or personel")
while True:
if acctype2=="business":
pers1=BusinessAccount()
pers1.Businessdeposit(cusd1,cusd2)
break
elif acctype2=="personel":
pers1=Personaldeposit()
pers1.person(cusd1,cusd2)
break
else:
print "provide correct accounttype"
continue
elif n==3:
sys.exit()
cho=raw_input("do you want to continue")
if cho=="yes":
continue
elif cho=="no":
sys.exit()