Computer Science Project-Bank Management System: Name: Aviral Srivastava Class: Xii
Computer Science Project-Bank Management System: Name: Aviral Srivastava Class: Xii
1
INDEX
INTRODUCTION
SOURCE CODE
OUTPUT
BIBLIOGRAPHY
2
INTRODUCTION
This program serves as a bank management system. It
can perform the following tasks:
Make a new account(s): It takes the name of the user
and appoints an account number and pin. An initial
deposit of more than Rs 500 is to be made. Multiple
accounts can be made in a go.
Login to your account: Entering the specific details, an
account can be accessed.
Perform various tasks: A number of tasks can be done
using this program:
1. Add money to the account.
2. Transfer money.
3. Check the balance.
4. Pay a variety number of bills.
5. Changing the pin.
6. Logging out and using a different account.
All the data is stored in three different files, and all the data
is accessed by the account number which is unifying bond
between the name of the account holder, pin and the
balance.
3
SOURCE CODE
import cPickle
import os
import random
import sys
t2 =dict()
t1 =dict()
t3 =dict()
name_file=open('name.dat', 'rb+')
pin_file=open('pin.dat', 'rb+')
balance_file=open('balance.dat', 'rb+')
t1[1]=1
t2[1]=1
t3[1]=1
cPickle.dump(t3, name_file)
cPickle.dump(t2, balance_file)
cPickle.dump(t1, pin_file)
4
print'If you want to register, enter 1.'
print'If you want to access an existing account, enter 2.'
initial_choice=input('>>>')
if initial_choice==1:
print "Welcome To Account Analyzer (Version 4.56 BETA)"
print '''
_______________________________________________________
------------------|======================|------------------
------------------| REGISTRATION PAGE |------------------
------------------|======================|------------------
_______________________________________________________
'''
a=input('Enter the Number of Accounts you Want to Create:')
for x in range (1, a+1):
name = raw_input('Please enter Your Name:')
no=random.randint(1000, 9999)
ac_no=10530000 + no
print 'Your Account Number is', ac_no, '(Remember This!!) \n'
5
t3[ac_no] = name
cPickle.dump(t3, name_file)
t1[ac_no] = pin
cPickle.dump(t1, pin_file)
f=input('Enter Your initial deposit(Must be Above 500 Rs):')
if f<500:
print('The Minimum Initial Deposit is 500 Rs!! \n')
break
else:
t2[ac_no] = f
6
cPickle.dump(t2, balance_file)
elif initial_choice==2:
print 'Directing you to Login page... \n'
else:
print 'Please enter a valid choice.'
while 1==1:
print '''
_______________________________________________________
----------------------|==============|----------------------
----------------------| LOGIN PAGE |----------------------
----------------------|==============|----------------------
_______________________________________________________
'''
7
for i in range (0,1):
r= input('Enter Registered Account Number:')
if r in t1:
print 'You are a Registered User. \n'
else:
print 'You are not a Registered User. \n'
break
kl=t3.get(r)
lk= raw_input('Enter Your Registered Name:')
if str(lk)==str(kl):
print 'The Account Was Registered in This Name. \n'
else:
print "Entered Name isn't correct. \n"
break
p=input('Enter the Pin (Must Be Of 4 Numericals):')
u=t1.get(r)
if u==p:
print 'The Pin You Entered Is Right. \n'
8
else:
print 'The Pin You Entered Is Wrong. \n'
break
if r in t1 and u==p and str(lk)==str(kl):
print '''
_______________________________________________________
----------------------|=============|----------------------
----------------------| HOME PAGE |----------------------
----------------------|=============|----------------------
_______________________________________________________
'''
print '\t \t Welcome To Avishant Bank Pvt. Ltd.'
print '\t \t Jitna Humara Utna Tumhara'
print 'Hello', lk, '!'
print ' Your Account number is ',r
ba=t2.get(r)
print 'Your current balance is ', ba
while (1):
9
g=input('The Following Are The Operations, Kindly Select
One:- \n 1. Add Money To Savings Account. \n 2. Transfer Money
\n 3. Check Your Balance \n 4. Pay Your Bills \n 5. Change Your Pin
\n 6. Cyber Security \n 7. Sign in With a Different Account \n 8.
Logout and Exit \n')
if g==1:
h=input('Enter The Amount You want To Add:')
j=input('Enter your Pin:')
if j==u:
ba=ba+h
t2[r]=ba
cPickle.dump(t2, balance_file)
print 'Your New Balance is ',ba, '\n'
else:
print 'The Pin you Entered is Wrong! \n'
elif g==2:
k=input('Enter the Recievers Account Number:')
l=input ('Enter the Amount you want to Transfer:')
j=input('Enter your Pin:')
if j==u:
ba=ba-l
10
t2[r]=ba
cPickle.dump(t2, balance_file)
print 'Amount Deducted From your Account', l ,
print 'Your current balance is ', ba, '\n'
else:
print 'The Pin you Entered is Wrong! \n'
elif g==3:
print 'Your Current Balance is', ba, '\n'
elif g==4:
menu=input('You Can Pay Bills For the Following
Utilities: \n 1. Electricity \n 2. DTH \n 3. Broadband Services \n 4.
Collections and Tax \n 5. Go To Home Page \n')
if menu == 1:
city = input('This is Applicable for the Following Cities
Only: \n 1. Delhi \n 2. Mumbai \n 3. Chennai \n 4. Bangalore \n 5.
Kolkata \n 6. Back \n Enter the State in whiich you Reside:')
if city == 1:
choose=input('Select Biller Name: \n 1. BSES
Yamuna Power Limited \n 2. BSES Rajdhani Power Limited \n 3.
Tata Power Limited \n 4. Back \n')
elec = input('Enter the Amount you Want to Pay:')
j=input('Enter your pin:')
11
if choose==4:
break
if j == u:
if elec <= ba:
print 'Succesfully Paid Your Bill. \n'
balance_file=open('balance.dat', 'rb+')
ba = ba - elec
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong. \n'
if city == 2:
choose=input('Select Biller Name: \n 1. Tatkal
BEST Undertaking \n 2. Tatkal Reliance Energy \n 3. Tata Power
Mumbai \n 4. Back \n')
elec = input('Enter the Amount you Want to Pay:')
j=input('Enter your pin:')
if choose == 4:
12
break
if j == u:
if elec <= ba:
print 'Succesfully Paid Your Bill. \n'
ba = ba - elec
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong. \n'
if city == 3:
print 'Only Tamil Nadu Electricity Board Present'
choose = input('1. Continue \n 2. Back \n')
if choose==2:
break
elec = input('Enter the Amount you Want to Pay:')
j=input('Enter your pin:')
if j == u:
13
if elec <= ba:
print 'Succesfully Paid Your Bill. \n'
ba = ba - elec
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong. \n'
if city == 4:
print 'Only Takal Bangalore Elec Supply Co
Present'
choose = input('1. Continue \n 2. Back \n')
if choose == 2:
break
elec = input('Enter the Amount you Want to Pay:')
j=input('Enter your pin:')
if j == u:
if elec <= ba:
print 'Succesfully Paid Your Bill. \n'
14
ba = ba - elec
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong. \n'
if city == 5:
choose=input('Select Biller Name: \n 1. West
Bengal State Electricity Distribution Company \n 2. West Bengal
State Electricity State Transmission Company \n 3. Back \n')
if choose == 3:
break
elec = input('Enter the Amount you Want to Pay:')
j = input('Enter Your Pin:')
if j == u:
if elec <= ba:
print 'Succesfully Paid Your Bill. \n'
ba = ba - elec
t2[r]=ba
cPickle.dump(t2, balance_file)
15
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong. \n'
if city == 5:
break
elif menu == 2:
brand = input('Which of the Following Cable
Operator you use: \n 1. DishTV \n 2. Tata Sky \n 3. Videocon D2H
\n 4. DEN \n 5. Back \n')
if brand == 5:
break
number = input('Enter the VC Number:')
dth = input('Enter the Amount you Want to Pay:')
j = input('Enter Your Pin:')
if j == u:
if dth <= ba:
print 'Succesfully Paid Your Bill. \n'
ba = ba - dth
t2[r]=ba
cPickle.dump(t2, balance_file)
16
else:
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin You Entered Is Wrong \n'
elif menu == 3:
brand = input('Choose Your Internet Service
Provider: \n 1. Airtel \n 2. DEN Boomband \n 3. Tata Docomo \n 4.
MTS \n 5. Back \n')
if brand == 5:
break
enter = input('Enter You CA number:')
internet = input('Enter The Amount You Want To
Pay:')
j = input('Enter your pin:')
if j == u:
if internet <= ba:
print 'Succesfully Paid Your Bill. \n'
ba = ba - dth
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
17
print "You Don't Have Sufficient Balance. \n"
else:
print 'The Pin you Entered Is Wrong! \n'
elif menu == 4:
choose = input('Enter The Cooperation: \n 1. BAJAJ
Finance Limited \n 2. Manappuram \n 3. Hero Fincorp Customer \n
4. Capital First Limited \n 5. Back \n')
if choose == 5:
break
Account = input('Enter The Loan Account Number:')
loan = input('Enter The Amount:')
j = input('Enter Your Pin:')
if j == u:
if loan <= ba:
print 'Succesful. \n'
ba=ba-loan
t2[r]=ba
cPickle.dump(t2, balance_file)
else:
print 'Insufficient Balance. \n'
else:
18
print 'The Pin You Entered Is Wrong! \n'
elif menu == 5:
break
elif g==5:
t=input('Enter Your Account number:')
if t==r:
np=input('Enter your Old Pin:')
if np==u:
aa=input('Enter Your New Pin:')
ab=input('Reconfirm Your New Pin:')
if ab==aa:
print 'Your New Pin is', aa, '\n'
t1[t] = aa
cPickle.dump(t1, pin_file)
print 'Please Sign Out and Login again with the
NEW PIN'
else:
print 'I Think That You Have Not Made up
Your Mind Till Now.... Please Be Sure And Then Try Again! \n'
else:
print "You Don't Even Know Your Pin?! \n"
19
else:
print "You Don't Even Know You Account Number?!
\n"
elif g==6:
print'Please be aware of the following: \n \t 1. Phishing is
a deception technique where fraudster uses fraudulent emails to
capture your personal sensitive information like passwords, CVV,
Date of Birth, Debit Card/ Credit Card Number, address, expiry
date, PIN etc. \n \t 2. Vishing (also known as Voice Phishing) is a
deception technique where the fraudster uses a phone call to lure you
into giving your personal confidential banking information. \n \t 3.
Smishing is a deception technique where the fraudster uses Short
Message Service (SMS) to send false message to lure you to call a
phone number or visit a website for giving your personal confidential
banking information. \n \t 4. Please don’t give any of your personal
confidential credentials like PAN, Date of Birth, Account Number,
Debit or Credit Card Number & its Expiry Date, Father/Mother’s
Name, User ID, Password, PIN, CVV, OTP etc. upon receiving the
Phishing, Vishing or Smishing. Our Bank never asks such
information from customers. \n'
elif g==7:
print '''
_______________________________________________________
20
----------------------|==============|----------------------
----------------------| LOGIN PAGE |----------------------
----------------------|==============|----------------------
_______________________________________________________
'''
for i in range (0,1):
r= input('Enter Registered Account Number:')
if r in t1:
print 'You are a Registered User. \n'
else:
print 'You are not a Registered User. \n'
quit()
kl=t3.get(r)
lk= raw_input('Enter Your Registered Name:')
if str(lk)==str(kl):
print 'The Account Was Registered in This Name.
\n'
else:
print "Entered Name isn't correct. \n"
21
quit()
p=input('Enter the Pin (Must Be Of 4 Numericals):')
u=t1.get(r)
if u==p:
print 'The Pin You Entered Is Right \n'
else:
print 'The Pin You Entered Is Wrong \n'
quit()
elif u!=p:
break
else:
break
if g>=8 and u!=p:
break
else:
break
name_file.close()
balance_file.close()
pin_file.close()
22
OUTPUT
23
OUTPUT FOR SIGNING IN AN ACCOUNT:
24
OUTPUT FOR ADDING MONEY:
25
OUTPUT FOR TRANSFERING MONEY:
26
OUTPUT FOR PAYING BILLS:
27
OUTPUT FOR CHANGING PIN:
28
OUTPUT FOR SIGNING IN ANOTHER ACCOUNT:
29
BIBLIOGRAPHY
INTERNET
NCERT COMPUTER SCIENCE CLASS XI
NCERT COMPUTER SCIENCE CLASS XII
30