0% found this document useful (0 votes)
16 views

CS investigatory project

Uploaded by

Kavita Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

CS investigatory project

Uploaded by

Kavita Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Bank

Management
System
BANKLE BANK

Name: Bhavya Bhardwaj


Class: XII-E

1
CONTENTS
1. Certificate

2. Synopsis

3. Python Features Incorporated

4. Source Code

5. Output

6. Bibliography

2
CERTIFICATE
This is to certify that student Bhavya Bhardwaj of
class XII E, has successfully completed the project
work entitled as "Bank Management System", in
the subject Computer Science (083) laid down in
the regulations of CBSE for the purpose of
Practical Examination in Class XII.

(Ms. Dimple Soni)

3
SYNOPSIS
The program titled "Bank Management
System" focuses on several key
functionalities essential for effective banking
operations. It enables the creation of new
customer accounts and provides tools for
managing existing account holders. This
includes modifying account details,
displaying account information, and handling
transactions. The system is designed to show
current balances and transaction details,
ensuring transparency for the users.
Additionally, it allows to delete the accounts
of the account holders, when necessary,
thereby offering a comprehensive digital
solution for managing various banking needs
efficiently.

4
PYTHON FEATURES
INCORPORATED
1. Python Modules
2. MySQL and Python Connectivity
3. Flow of Control Statements:
i. while loop
ii. if…elif…else statement
4. Built-in functions and user defined functions
5. Python operators:
i. Arithmetic operators
ii. Relational operators
iii. Identity and Membership operators
6. Explicit type conversion

5
SOURCE CODE
pr1.py
import mysql.connector as sql

conn = sql.connect(
host='localhost',
user='root',
passwd='manager',
database='bank'
)

if conn.is_connected():
print('Connected successfully')

cur = conn.cursor()

cur.execute('''
CREATE TABLE customer_details (
acct_no INT PRIMARY KEY,
acct_name VARCHAR(25),
phone_no BIGINT,
address VARCHAR(25),
cr_amt FLOAT
)
''')

print("Table 'customer_details' created


successfully")

conn.close()

6
PR2.py

import mysql.connector as sql

conn = sql.connect(host='localhost',
user='root', password='1234', database='bank')
cur = conn.cursor()
conn.autocommit = True

while True:

print('____________________________________')
print('')
print('\tBank Management System\n')
print('\tWELCOME to Bankle Bank')

print('____________________________________')
print('')
print('1. CREATE BANK ACCOUNT')
print('2. TRANSACTION')
print('3. DISPLAY CUSTOMER DETAILS')
print('4. TRANSACTION DETAILS')
print('5. MODIFY CUSTOMER DETAILS')
print('6. DELETE ACCOUNT')
print('7. QUIT')
n = int(input('Enter your CHOICE = '))
if n == 1:
7
acc_no = int(input('Enter your ACCOUNT
NUMBER = '))
acc_name = input('Enter your ACCOUNT
NAME = ')
ph_no = int(input('Enter your PHONE
NUMBER = '))
add = input('Enter your ADDRESS = ')
cr_amt = int(input('Enter your CREDIT
AMOUNT = '))

cur.execute(f"INSERT INTO
customer_details VALUES ({acc_no},
'{acc_name}', {ph_no}, '{add}', {cr_amt})")
print('Account Created
Successfully!!!!!')
elif n == 2:
acct_no = int(input('Enter Your Account
Number = '))
cur.execute(f'SELECT * FROM
customer_details WHERE acct_no = {acct_no}')
data = cur.fetchall()
count = cur.rowcount

if count == 0:
print('Account Number Invalid.
Sorry, Try Again Later')
else:
print('1. WITHDRAW AMOUNT')
print('2. ADD AMOUNT')

8
x = int(input('Enter your CHOICE =
'))

if x == 1:
amt = int(input('Enter
Withdrawal Amount = '))
cur.execute(f'UPDATE
customer_details SET cr_amt = cr_amt - {amt}
WHERE acct_no = {acct_no}')
print('Account Updated
Successfully!!!!!')
elif x == 2:
amt = int(input('Enter Amount
to be Added = '))
cur.execute(f'UPDATE
customer_details SET cr_amt = cr_amt + {amt}
WHERE acct_no = {acct_no}')
print('Account Updated
Successfully!!!!!')
elif n == 3:
acct_no = int(input('Enter your Account
Number = '))
cur.execute(f'SELECT * FROM
customer_details WHERE acct_no = {acct_no}')

if cur.fetchone() is None:
print('Invalid Account Number')
else:
cur.execute(f'SELECT * FROM
customer_details WHERE acct_no = {acct_no}')

9
data = cur.fetchall()

for row in data:


print(f'ACCOUNT NO =
{acct_no}')
print(f'ACCOUNT NAME =
{row[1]}')
print(f'PHONE NUMBER =
{row[2]}')
print(f'ADDRESS = {row[3]}')
print(f'CREDIT AMOUNT =
{row[4]}')
elif n == 4:
acct_no = int(input('Enter your Account
Number = '))

cur.execute(f'SELECT * FROM
customer_details WHERE acct_no = {acct_no}')
if cur.fetchone() is None:
print('Invalid Account Number')
else:
cur.execute(f'SELECT * FROM
customer_details WHERE acct_no = {acct_no}')
data = cur.fetchall()

for row in data:


print(f'ACCOUNT NO =
{acct_no}')

10
print(f'ACCOUNT NAME=
{row[1]}')
print(f'CURRENT BALANCE =
{row[4]}')
elif n==5:
acct_no=int(input('Enter your Account
Number='))
print('a. MODIFY ACCOUNT NAME')
print('b. MODIFY PHONE NUMBER')
print('c. MODIFY ADDRESS')
print('d. CREDIT AMOUNT')
m= (input("Enter your choice:"))
if m=='a':
x=(input("Enter New Account
Name:"))
cur.execute(f"UPDATE
customer_details SET acct_name='{x}' WHERE
acct_no={acct_no}")
print("Account Name updated.")
if m=='b':
x=int(input("Enter New Phone
Number:"))
cur.execute(f'UPDATE
customer_details SET phone_no={x} WHERE
acct_no={acct_no}')
print("Phone number updated.")
if m=='c':
x=input("Enter New Address:")

11
cur.execute(f"UPDATE
customer_details SET address='{x}' WHERE
acct_no={acct_no}")
print("Address updated.")
if m=='d':
x=int(input("Enter New Credit
Amount:"))
cur.execute(f'UPDATE
customer_details SET cr_amt={x} WHERE
acct_no={acct_no}')
print("Credit amount updated.")
elif n == 6:
print('DELETE YOUR ACCOUNT')
acct_no = int(input('Enter your Account
Number = '))
cur.execute(f'DELETE FROM
customer_details WHERE acct_no = {acct_no}')
print('ACCOUNT DELETED SUCCESSFULLY')
elif n == 7:
quit()
conn.close()

12
pr1.py:
OUTPUT
Python:

MySQL:

13
PR2.py:

Python:

➔ For CREATING Bank Account:


Python:

MySQL:

14
Similarly,
Python:

MySQL:

15
➔ For TRANSACTIONS:
-WITHDRAWING AMOUNT-
Python:

MySQL:

-ADDING AMOUNT-
Python:

16
MySQL:

➔ For Customer Details:

Python:

17
➔ For TRANSACTION Details:

Python:

➔ FOR DELETE DETAILS:

Python:

MySQL:

18
➔ FOR MODIFYING DETAILS:

a) ACCOUNT NAME
PYTHON:

MySQL:

19
b) PHONE NUMBER
PYTHON:

MySQL:

c) ADDRESS
PYTHON:

20
MySQL:

d) CREDIT AMOUNT
PYTHON:

MySQL:

21
➔ FOR QUITTING THE PROGRAM
PYTHON:

22
BIBLIOGRAPHY
1. Computer Science Textbook for Class XII-
NCERT
2. Computer Science with Python Textbook for
Class XII -Sumita Arora
3. Computer Science with Python Textbook for
Class XI - Sumita Arora
4. Computer Science Textbook for Class XI-
NCERT

23

You might also like