0% found this document useful (0 votes)
35 views21 pages

Chemistry

Chemistry

Uploaded by

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

Chemistry

Chemistry

Uploaded by

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

PM SHRI KENDRIYA VIDYALAYA KARWAR

COMPUTER SCIENCE

PROJECT ON:
“BANK MANAGEMENT SYSTEM”

GUIDED BY: Mrs. KAJAL (PGT COMPUTER SCIENCE)

SUBMITTED BY: ARUL KUMAR


CERTIFICATE

This is to certify that Master ARUL KUMAR a student Of class 12th A science
has successfully completed the project “Bank Management System” under
guidance of Mrs. KAJAL ( PGT-COMPUTER SCIENCE). During the academic year
2024-25.

SIGN OF EXTERNAL EXAMINER:

SIGN OF SUBJECT TEACHER:

SIGN OF PRINCIPAL:

ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to my
teacher Mrs. Kajal as well as our principal sir, who gave me
the golden opportunity to do this wonderful project.

This project also helped me in doing a lot of research and I


came to know about so many new things. I am extremely
grateful to my parents and my friends who gave valuable
suggestion and guidance for completion of my project.

SIGNATURE OF STUDENT:

INDEX
SR NO. CONTENTS PAGE NO.
1. INTRODUCTION 5-7
i. ABOUT PYTHON 5
ii. ABOUT MYSQL 6
iii. ABOUT BANK MANAGEMENT
SYSTEM 7

2. SOURCE CODE 8-15


3. OUTPUT 16-20
4. BIBLIOGRAPHY 21

INTRODUCTION
ABOUT PYTHON:
Python is an interpreted, object oriented, high level
programming language with dynamic semantics. It’s high
level built in data structures, combined with dynamic typing
dynamic binding, make it attractive for rapid application
development, as well as for use as a scripting or glue
language to connect existing components together. Python’s
simple, easy to learn syntax emphasises readability and
therefore reduces the cost of program maintenance. Python
supports modules and packages, which encourages program
modularity and code reuse. The python interpreter and the
extensive standard library are available in source or binary
form without charge for all major platforms, and can be
freely distributed.

Often, programmers fall in love with python because of the


increased productivity it provides. Since there is no
compilation step, the edit-test-debug cycle is incredibly fast.
Debugging python programs is easy: a bug or bad input will
never cause a segmentation fault. Instead, when the
interpreter discovers an error, it raises an exception. When
the program doesn’t catch the exception, the interpreter
prints stacks trace.

ABOUT MYSQL:
MySQL is a fast, easy-to-use RDBMS being used fir many
small and big businesses. MySQL is developed, marketed and
supported by MySQL AB, which is a Swedish company.
MySQL is becoming so popular because of many reasons:-
● MySQL is released under an open-source license. So you
have nothing to pay to use it.

● MySQL is a very powerful program in its own right. It


handles a large subset of the functionality of the most
expensive and powerful database packages.

● MySQL uses a standard form of the well-known SQL data


language.
● MySQL works on many operating systems and with
many languages including PHP, PERL, C, C++, JAVA, etc.

● MySQL works very quickly and works well even with


large datasets.

● MySQL is very friendly to PHP, the most appreciated


language for development.

MySQL is customizable. The open-source GPL license


allows programmers to modify the MySQL software to fit
their own specific environments.
About bank management system:
Bank management system is based on NETA and is a major
project for students. It is used to keep the records of
clients, employees etc in bank. The bank management
system is an application for maintaining a person C/S
account in a bank. The system provides the access to the
customer to create an account deposit/withdraw the cash
from his account, also to view reports of all accounts
present. The following presentation provides the
specification for the system.

SOURCE CODE
import mysql.connector

# Connect to MySQL Database


def connect_to_db():
return mysql.connector.connect(
host="localhost",
user="root", # Replace with your MySQL username
password="root", # Replace with your MySQL
password
database="bank_management"
)

# Create Account Function


def create_account():
conn = connect_to_db()
cursor = conn.cursor()

acc_no = int(input("Enter account number: "))


name = input("Enter account holder name: ")
acc_type = input("Enter account type (Savings/Current): ")
balance = float(input("Enter initial deposit amount: "))
query = "INSERT INTO accounts (acc_no, name, acc_type,
balance) VALUES (%s, %s, %s, %s)"
values = (acc_no, name, acc_type, balance)

cursor.execute(query, values)
conn.commit()
conn.close()

print("Account created successfully!\n")

# View Account Details


def view_account():
conn = connect_to_db()
cursor = conn.cursor()

acc_no = int(input("Enter account number: "))

query = "SELECT * FROM accounts WHERE acc_no = %s"


cursor.execute(query, (acc_no,))

account = cursor.fetchone()
if account:
print(f"Account No: {account[0]}")
print(f"Account Holder Name: {account[1]}")
print(f"Account Type: {account[2]}")
print(f"Balance: {account[3]}\n")
else:
print("Account not found!\n")

conn.close()

# Deposit Amount Function


def deposit_amount():
conn = connect_to_db()
cursor = conn.cursor()

acc_no = int(input("Enter account number: "))


amount = float(input("Enter amount to deposit: "))

query = "SELECT balance FROM accounts WHERE acc_no =


%s"
cursor.execute(query, (acc_no,))
account = cursor.fetchone()
if account:
new_balance = account[0] + amount
update_query = "UPDATE accounts SET balance = %s
WHERE acc_no = %s"
cursor.execute(update_query, (new_balance, acc_no))
conn.commit()
print("Amount deposited successfully!\n")
else:
print("Account not found!\n")

conn.close()

# Withdraw Amount Function


def withdraw_amount():
conn = connect_to_db()
cursor = conn.cursor()

acc_no = int(input("Enter account number: "))


amount = float(input("Enter amount to withdraw: "))

query = "SELECT balance FROM accounts WHERE acc_no =


%s"
cursor.execute(query, (acc_no,))
account = cursor.fetchone()

if account:
if account[0] >= amount:
new_balance = account[0] - amount
update_query = "UPDATE accounts SET balance = %s
WHERE acc_no = %s"
cursor.execute(update_query, (new_balance, acc_no))
conn.commit()
print("Amount withdrawn successfully!\n")
else:
print("Insufficient balance!\n")
else:
print("Account not found!\n")

conn.close()

# Delete Account Function


def delete_account():
conn = connect_to_db()
cursor = conn.cursor()

acc_no = int(input("Enter account number: "))


query = "DELETE FROM accounts WHERE acc_no = %s"
cursor.execute(query, (acc_no,))
conn.commit()

if cursor.rowcount > 0:
print("Account deleted successfully!\n")
else:
print("Account not found!\n")

conn.close()

# Main Menu
def main():
while True:
print("\t\t\t\t**********************")
print("\t\t\t\tBank Management System")
print("\t\t\t\t**********************")
print("1. Create a new account")
print("2. View account details")
print("3. Deposit money")
print("4. Withdraw money")
print("5. Delete account")
print("6. Exit")

choice = input("Enter your choice (1-6): ")

if choice == '1':
create_account()
elif choice == '2':
view_account()
elif choice == '3':
deposit_amount()
elif choice == '4':
withdraw_amount()
elif choice == '5':
delete_account()
elif choice == '6':
print("Thank you\nVisit Again!")
break
else:
print("Invalid choice! Please try again.\n")

# Running the main function


if __name__ == "__main__":
main()

OUTPUT
BIBLIOGRAPHY

BOOKS:
SUMITA ARORA-COMPUTER SCIENCE WITH PYTHON
WEBSITES:
https://www.python.org
https://www.wikipedia.org
https://www.w3schools.com

You might also like