0% found this document useful (0 votes)
10 views39 pages

Cs Pro F

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views39 pages

Cs Pro F

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

SESSION:2023-24

BANK MANAGEMENT

SUBMITTED TO: SUBMITTED BY:


MRS.SHRUTI SRIVASTAVA AYUSH VARPE
PGT(COMP SC) XII-C
CERTIFICATE

CLASS : XII-C YEAR : 2023-24

This is to certify that Ayush Varpe of class XII C of Kendriya


Vidyalaya ONGC Panvel has done her project on BANK
MANAGEMENT under my supervision. He has taken interest and has
shown at most sincerity in completion of this project.
I certify this Project up to my expectation & as per guidelines
issued by CBSE.

Internal Examiner External Examiner

Principal School Stamp


ACKNOWLEDGEMENT

It is with pleasure that I acknowledge my sincere gratitude to our


teacher, Mrs. Shruti Srivastava who taught and undertook the
responsibility of teaching the subject computer science. I have
been greatly benefited from his classes.
I am especially indebted to our Principal Vijay Kumar Garg
who has always been a source of encouragement and support
and without whose inspiration this project would not have been a
successful I would like to place on record heartfelt thanks to him.
Finally, I would like to express my sincere appreciation for all the
other students for my batch their friendship & the fine times that
we all shared together.
INDEX

S.No. TOPIC PAGE NO

1. Summary of the project 1

2.
Requirements (hardware & 2
software)

3. Flow Charts 3

4. Database tables and structures 9

5. Python source code 11

6. Output 28

7. Bibliography 35
SUMMARY OF THE PROJECT

This project ‘BANK MANAGEMENT’ has been developed on


PYTHON and MySQL an open source RELATIONAL DATABASE
MANAGEMENT SYSTEM that uses SQL in which information are
stored in tables. MySQL provides a rich set of features that support a
secure environment for storing, maintaining, and accessing data.

The main purpose of this project is to manage the details of products,


purchases, stocks, and sales of all kind of fashion clothes.

In this project we are able to perform following functions:

1. Add, edit, delete the details of bank accounts


2. View the account details such as amount current in account, the
history and types of transactions done, id and rates
3. Access customer details via admin function
4. Manage details of employees of the bank

1
REQUIREMENTS

HARDWARE:
Processor – Intel core i5-8265U CPU 1.60 –
1.80 GHz
RAM – 64 MB
Hard-disc – 20 GB
Printer – To print the documents of the project

SOFTWARE:
Operating system – Windows-10
Language – Python 3.8
Database – MySQL 8.0
MS Word – For presentation of project

2
FLOW CHART

START

HOME
ADMIN PAGE
CHECK (customer
/admin)

USER
MENU

3
ADMIN
CHECK

UNSUCCESSFUL

HOME CONFIRMING FOR


PAGE ADMIN

CONFIRMED

ADMIN
MENU

4
ADMIN
MENU

1.See
accounts
See 2.See See
Accounts transactions Transactions
3.Employee
menu

EMPLOYEE
MENU

5
EMPLOYEE
MENU

1.Add an employee
2.Update details
3.See list of
employees
4.Remove an
employee

If ch=1 If ch=2
Enter
Adding an your Updating
employee choice details

If ch=3 If ch=4
Seeing list Enter Removing
of your an
employees choice employee
6
USER
MENU

1.Sign-up
2.Login
HOME
PAGE

If unsuccessful
If ch=1 If ch=2
Enter
Signing up your Logging in
choice

If successful

MENU

7
MENU

1.Create bank account


2.Deposit in account
3.Withdraw from account
4.See balance
5. See transactions
6.Change account details

Enter Enter
your deposit balance your
choice choice

Enter
your
Create choice Change
bank details
account

transactions
withdrawal
8
TABLE STRUCTURES

Table - admin

Table- bankacc

Table- employee

9
Table - transactions

Table - userid

10
SOURCE CODE
import mysql.connector
import datetime
import random
mydb=mysql.connector.connect(user="root",host="localhost",passwd="t
iger")
mycur=mydb.cursor()
mycur.execute("create database if not exists bank")
mycur.execute("use bank")
query='create table if not exists bankacc(accno int(7) primary key,name
varchar(35),age int(2),gender char(1),city varchar(15),mobileno
int(10),balance int(10))'
mycur.execute(query)

mycur.execute("create table if not exists transactions(accno int(7),name


varchar(35),amount int(8),type char(1),date date)")
mycur.execute("create table if not exists userid(username
varchar(15),password varchar(8))")
mycur.execute("create table if not exists employee(ename
varchar(15),eid int(5),eage int(2),emobileno int(10),edesg
varchar(15),esal int(7))")
mycur.execute("create table if not exists admin(name
varchar(15),password int(5))")
mycur.execute("insert into admin values('Ayush',12303)")
mycur.execute("insert into admin values('Ashutosh',12303)")
mycur.execute("insert into admin values('Parth',12306)")
11
mydb.commit()

def createaccount():
print("****CREATE A NEW ACCOUNT****")
acno=random.randint(1,9999999)
nm=input("enter your name:")
age=int(input("enter your age:"))
gender=input("enter gender (M,F,O):")
city=input("enter name of city where you live:")
mono=int(input("enter your mobile no(10 digits):"))
bal=0
mycur.execute("insert into bankacc
values({},'{}',{},'{}','{}',{},{})".format(acno,nm,age,gender,city,mono,bal)
)
mydb.commit()
print("account created")
print("your account number is:",acno)
c=input("do you want to continue?(y/n):")
if c=="y":
menu()
else:
print("!!THANK YOU VERY MUCH!!")
def deposit():
print("****DEPOSIT IN YOUR ACCOUNT****")
acno=int(input("enter your account number:"))
nm=input("enter your name:")
dep=int(input("enter amount you want to deposit:"))
typet="D"

12
mycur.execute("update bankacc set
balance=balance+{} where
accno={}".format(dep,acno))
mycur.execute("insert into transactions
values({},'{}',{},'{}',curdate())".format(a
cno,nm,dep,typet))
mydb.commit()
c=input("do you want to
continue?(y/n):")
if c=="y":
menu()
else:
print("!!THANK YOU VERY
MUCH!!")
def withdrawal():
print("****WITHDRAW FROM
YOUR ACCOUNT****")
acno=int(input("enter your account
number:"))
nm=input("enter your name:")
wit=int(input("enter amount you want
to withdraw:"))
typet="W"

13
mycur.execute("update bankacc set balance=balance-{} where
accno={}".format(wit,acno))
mycur.execute("insert into transactions
values({},'{}',{},'{}',curdate())".format(acno,nm,wit,typet))
mydb.commit()
c=input("do you want to continue?(y/n):")
if c=="y":
menu()
else:
print("!!THANK YOU VERY MUCH!!")

def balance():
print("****SEE YOUR BALANCE****")
acno=int(input("enter account number:"))
mycur.execute("select*from bankacc where accno={}".format(acno))
data=mycur.fetchall()
if data is None:
print("incorrect input")
print("1.retry")
print("2.go to menu")
ch=int(input("enter your choice:"))
if ch==1:
balance()
else:
menu()
14
else:
for row in data:
print(row)
c=input("do you want to continue?(y/n):")
if c=="y":
menu()
else:
print("!!THANK YOU VERY MUCH!!")

def transaction():
print("****SEE YOUR TRANSACTIONS****")
acno=int(input("enter account number:"))
mycur.execute("select*from transactions where
accno={}".format(acno))
data=mycur.fetchall()
if data is None:
print("incorrect input")
print("1.retry")
print("2.go to menu")
ch=int(input("enter your choice:"))
if ch==1:
transaction()
else:
menu()
else:
for row in data:
print(row)
c=input("do you want to continue?(y/n):")
if c=="y":
menu()
else:
print("!!THANK YOU VERY MUCH!!")

def login():
print("****LOGIN****")
u=input("enter username:") 15
p=input("enter paswword:")
mycur.execute("select*from userid where username='{}' and
password='{}'".format(u,p))
data=mycur.fetchone()
if data is None:
print("incorrect input.try again")
login()
else:
print("login successful")
menu() )

def signup():
print("****SIGN-UP****")
u=input("enter username:")
p=input("enter password(max 8 characters,numbers only):")
mycur.execute("insert into userid values('{}','{}')".format(u,p))
mydb.commit()
print("signup successful")
menu()

def usermenu():
print("****USERMENU****")
print("1.signup")
print("2.login")
print("3.exit")
ch=int(input("enter your choice(1/2/3):"))
if ch==1:
signup()
elif ch==2:
login()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("wrong input.Try again")
usermenu()
16
def admincheck():
print("****CONFIRMING FOR ADMIN****")
u=input("enter name:")
p=int(input("enter password:"))
mycur.execute("select*from admin where name='{}' and
password={}".format(u,p))
data=mycur.fetchall()
if data is None:
print("incorrect input.directing to homepage")
enter()
else:
print("admin login successfull")
adminmenu()

def adminmenu():
print("*****ADMIN MENU******")
print("1.see all accounts")
print("2.see all transactions")
print("3.see employees")
print("4.go to homepage")
print("5.exit")
ch=int(input("enter your choice:"))
if ch==1:
seeacc()
elif ch==2:
seetrans()
elif ch==3:
empmenu()
elif ch==4:
enter()
elif ch==5:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.try again")
adminmenu()
17
def seeacc():
print("****SEE ALL ACCOUNTS****")
mycur.execute("select*from bankacc")
data=mycur.fetchall()
if data is None:
print("No Data")
else:
for row in data:
print(row)
print("*******************")
print("1.Go to admin menu:")
print("2.exit")
ch=int(input("enter your choice:"))
if ch==1:
adminmenu()
elif ch==2:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

def seetrans():
mycur.execute("select*from transactions")
data=mycur.fetchall()
if data is None:
print("No Data")
else:
for row in data:
print(row)
print("*******************")
print("1.Go to admin menu:")
print("2.exit")
ch=int(input("enter your choice:"))
if ch==1:
adminmenu() 18
elif ch==2:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

def accdet():
print("****UPDATE YOUR ACCOUNT****")
print("1.change name")
print("2.change address")
print("3.change mobile number")
print("4.exit")
acno=int(input("enter your account number:"))
ch=int(input("enter your choice:"))
if ch==1:
print("****UPDATE NAME****")
n=input("enter new name:")
mycur.execute("update bankacc set name='{}' where
accno={}".format(n,acno))
mydb.commit()
print("detail added successfully")
print("*****************************")
print("1.want to change more details")
print("2.go to menu")
print("3.exit")
cho=int(input("enter your choice"))
if cho==1:
accdet()
elif ch==2:
menu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter() 19
elif ch==2:
print("****UPDATE ADDRESS****")
a=input("enter new address:")
mycur.execute("update bankacc set city='{}' where
accno={}".format(a,acno))
mydb.commit()
print("detail added successfully")
print("1.want to change more details")
print("2.go to menu")
print("3.exit")
cho=int(input("enter your choice"))
if cho==1:
accdet()
elif ch==2:
menu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

elif ch==3:
print("****UPDATE MOBILE NO****")
m=int(input("enter new new mobile number:"))
mycur.execute("update bankacc set mobileno='{}' where
accno={}".format(m,acno))
mydb.commit()
print("detail added successfully")
print("1.want to change more details")
print("2.go to menu")
print("3.exit")
cho=int(input("enter your choice"))
if cho==1:
accdet()
elif ch==2:
menu() 20
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

elif ch==4:
print("!!THANK YOU VERY MUCH!!")

else:
print("incorrect input.try again")
accdet()

def empmenu():
print("*********EMPLOYEE MENU*********")
print("1.enter details of new employee")
print("2.update your details")
print("3.see list of all employees")
print("4.remove an employee")
print("5.go to admin menu")
print("6.exit")
ch=int(input("enter your choice:"))
if ch==1:
newemp()
elif ch==2:
updateemp()
elif ch==3:
seeall()
elif ch==4:
rememp()
elif ch==5:
adminmenu()
elif ch==6:
print("!!THANK YOU VERY MUCH!!")
else: 21
print("incorrect input.redirecting....")
empmenu()

def newemp():
print("****ENTER DETAILS OF NEW EMPLOYEE****")
n=input("enter your name:")
i=int(input("enter your id no:"))
a=int(input("enter your age:"))
no=int(input("enter your mobile no:"))
desg=input("enter your designation:")
sal=int(input("enter your salary:"))
mycur.execute("insert into employee
values('{}',{},{},{},'{}',{})".format(n,i,a,no,desg,sal))
mydb.commit()

print("details added successfully")


print("1.enter another new employee")
print("2.go to employee menu")
print("3.exit")
ch=int(input("enter your choice:"))
if ch==1:
newemp()
elif ch==2:
empmenu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

def updateemp():
print("****UPDATE EMPLOYEE's DETAILS****")
print("1.update mobile no")
print("2.update designation") 22
print("3.update salary")
print("4.exit")
ch=int(input("enter your choice:"))
if ch==1:
updno()
elif ch==2:
upddesg()
elif ch==3:
updsal()
elif ch==4:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.redirecting...")

def updno():
i=int(input("enter your id no:"))
no=int(input("enter new mobile no:"))
mycur.execute("update employee set emobileno={} where
eid={}".format(no,i))
mydb.commit()
print("details updated successfully")
print("1.change another details")
print("2.go to employee menu")
print("3.exit")
ch=int(input("enter your choice:"))
if ch==1:
updateemp()
elif ch==2:
empmenu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
23
def upddesg():
i=input("enter your id no:")
d=input("enter new designation:")
mycur.execute("update employee set edesg='{}' where
eid={}".format(d,i))
mydb.commit()
print("details updated successfully")
print("1.change another details")
print("2.go to employee menu")
print("3.exit")
ch=int(input("enter your choice:"))
if ch==1:
updateemp()
elif ch==2:
empmenu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")

def updsal():
i=int(input("enter your id no:"))
s=int(input("enter new salary:"))
mycur.execute("update employee set esal={} where
eid={}".format(s,i))
mydb.commit()
print("details updated successfully")
print("1.change another details")
print("2.go to employee menu")
print("3.exit")
ch=int(input("enter your choice:"))
if ch==1:
updateemp()
elif ch==2:
empmenu()
elif ch==3: 24
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")

def seeall():
mycur.execute("select*from employee")
data=mycur.fetchall()
if data is not None:
for i in data:
print(i)
else:
print("no data available")
print("1.go to employee menu")
print("2.exit")
ch=int(input("enter your choice:"))
if ch==1:
empmenu()
elif ch==2:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")
enter()

def rememp():
print("REMOVE AN EMPLOYEE")
i=int(input("enter id of th employee:"))
mycur.execute("delete from employee where eid={}".format(i))
mydb.commit()
print("record deleted successfully")
print("1.delete another record")
print("2.go to employee menu")
print("3.exit")
ch=int(input("enter your choice:"))
if ch==1:
rememp() 25
elif ch==2:
empmenu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("incorrect input.directing to homepage")

def menu():
print("****************MENU****************")
print("1.create bank account")
print("2.deposit in your account")
print("3.withdraw from your account")
print("4.see balance of your account")
print("5.see transactions of your account:")
print("6.change account details")
print("7.exit")
print("************************************")
ch=int(input("enter your choice:"))
if ch==1:
createaccount()

elif ch==2:
deposit()

elif ch==3:
withdrawal()

elif ch==4:
balance()

elif ch==5:
transaction()

elif ch==6:
accdet() 26
elif ch==7:
print("THANK YOU VERY MUCH")

else:
print("incorrect input.redirecting...")
menu()

def enter():
print("HOME PAGE")
print("1.admin")
print("2.user")
print("3.exit")
ch=int(input("enter your choice(1/2/3):"))
if ch==1:
admincheck()
elif ch==2:
usermenu()
elif ch==3:
print("!!THANK YOU VERY MUCH!!")
else:
print("wrong input.Try again")
enter()

enter()

27
OUTPUT

28
29
30
31
32
33
34
BIBLIOGRAPHY

 https://pythontrends.wordpress.com/
 https://shrutipgtcs.wordpress.com/
 Computer Science with Python
textbook class 12th by Sumita Arora

35

You might also like