-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbank.py
More file actions
64 lines (55 loc) · 1.99 KB
/
Copy pathbank.py
File metadata and controls
64 lines (55 loc) · 1.99 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
#Write a mneu driven Program for banking system
class AccountP(object):
def __init__(self, name, account_number, initial_amount, pack):
self._name = name
self._no = account_number
self._balance = initial_amount
self._p = pack
def deposit(self, amount):
self._balance += amount
def withdraw(self, amount):
self._balance -= amount
def get_balance(self):
return self._balance
def compute_interest(self,amount,t,r):
self._p = self._balance
self._p = ((self._p*t*r)/100)
return self._p
#Main program
import random
ch=1
p=0
p=random.randint(101,999)
while ch!=7:
print("\n\n****************************************************")
print("Welcome to the Bank of Wadiya")
print("****************************************************")
print("\n1 : Create Account")
print("2 : Deposit")
print("3 : Withdraw")
print("4 : Rate of interest")
print("5 : Display Balance")
print("6 : Display Account Details")
print("7 : Exit")
ch=int(input("\nEnter Your Choice :"))
if(ch==1):
a1 = AccountP(input("Enter name : "),int(p),int(input("Enter the initial amount :")),print())
print("Account created Successfuly")
elif(ch==2):
a1.deposit(int(input("Enter the amount you want to deposit : ")))
print("The total balance of the customer is : ",a1._balance)
elif(ch==3):
a1.withdraw(int(input("Enter the amount to be withdrawn : ")))
print("The available balance is : ",a1._balance)
elif(ch==4):
a1.compute_interest(a1._p,int(input("Enter the rate of no 0f years : ")),int(input("Enter the rate of interest : ")))
print("The rate of interestis : " ,a1._p)
elif(ch==5):
print("The balance in the account is : Rs.",a1.get_balance())
elif(ch==6):
print("Name : ",a1._name)
print("Account No: ",p)
elif(ch==7):
print("LOGGING OUT......")
else:
print("Wrong Choice!!!!")