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

Computer Science Project (bank management)

The document outlines a Computer Science project on a Bank Management System submitted by Kartik Chaturvedi from Kalka Public School. It includes acknowledgments, system requirements, an introduction to Python, a synopsis of the project objectives and features, source code for the system, suggestions for improvements, and a bibliography. The project aims to create a user-friendly platform for managing bank accounts and transactions efficiently.

Uploaded by

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

Computer Science Project (bank management)

The document outlines a Computer Science project on a Bank Management System submitted by Kartik Chaturvedi from Kalka Public School. It includes acknowledgments, system requirements, an introduction to Python, a synopsis of the project objectives and features, source code for the system, suggestions for improvements, and a bibliography. The project aims to create a user-friendly platform for managing bank accounts and transactions efficiently.

Uploaded by

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

Computer Science Project

Kalka Public School

Topic: Bank Management System


Class- XII A
Roll no. 22
Submitted By- Kartik Chaturvedi
Submitted to- Amjad Sir
Acknowledgement
I would like to take this opportunity to express my gratitude to those who
have been of great assistance in finishing this project in due course of the
stipulated deadline. To begin with, I would like to thank Principal ma'am,
Dr. Anju Mehrotra for her encouragement and for providing me with all the
required facilities for completing my project.

I extend my heartfelt thanks to Mr. Amjad Khan our Computer Science


teacher, who guided me in successful completion of this project. I take this
opportunity to express my deep sense of gratitude for her invaluable
guidance, attitude and immense motivation, which has sustained my
efforts at all stages of this project work.

I would also acknowledge my gratitude towards my classmates for having


been a source of inspiration and for their patience in resolving what I
couldn't grasp efficiently. I thank them in earnest for correcting me where
I erred and their recommendations. I thank them all for expanding my
interest in the study that is programming.

At last I would like to thank my parents for constantly pushing me and


motivating me to do my best

Submitted by

Pramesh Khadka
Certificate
This is to certify that this work entitled Hotel Management System
was done under my guidance and submitted on:_________

For Central Board of Secondary Examination


2024-2025 is the original work of candidate

Signature of the candidate Signature of the Internal Examiner

Signature of the principal Signature of the External Examiner


INDEX

• SYSTEM REQUIREMENTS

• SYNOPSIS

• SOURCE CODE

• OUTPUT

• SCOPE FOR IMPROVEMENT

• BIBLIOGRAPHY
INTRODUCTION
About Python:
Python is a widely used general-purpose, high level programming
language. It was created by Guido Van Rossum in 1991 and further
developed by the Python software foundations. It was designed
with an emphasis on code readability, and its syntax allows
programmers to express the concept in fewer lines of code.

Python is a programming language that lets you work quickly and


more efficiently. Python is an easy to learn, powerful
programming language. It is an object-oriented programming
language. It is a free and open source. Python's elegant syntax and
dynamic typing, together with its interpreted nature, make it an
ideal language for scripting and rapid application development in
many areas on most platforms.

Python is a good programming language for beginners. It is a high-


level language, which means a programmer can focus on what to
do instead of how to do it. Writing programs in Python takes less
time than in some other languages.

One of the key features of Python is its versatility. It can be used


for web development, data analysis, artificial intelligence,
scientific computing, and more. The simplicity of Python makes it
an excellent language for beginners, yet its robust set of libraries
and frameworks means it remains a powerful tool for advanced
programme
SYSTEM REQUIREMENTS

Hardware Requirements:

Hardware is a set of tangible component of a computer


which stores and runs the written instructions provided by
the software.

• 2.40 GHz Processor or above.

• 8.00 GB or above.

• Required memory of hard disk space.

Software Requirements:

Software represents the set of programs that govern the


operation of a computer system and make the hardware
run.

• Operating System Windows 10 Pro or higher. 64-bit


operating system or above.

Program needs Python to run the developed


software. Database, MYSQL.
SYNOPSIS
Introduction

In today's fast-paced world, car rental services have become an


essential part of our lives, offering convenience and flexibility for
travel and transportation needs. This project aims to develop a
comprehensive car rental system using Python programming
language. By creating a user-friendly and efficient platform, this
system will streamline the car rental process for both customers and
rental companies.

Objective and Benefits

The primary objective of this car rental system is to provide a


convenient and reliable solution for managing car rentals, customer
information, and financial transactions. By automating various aspects
of the rental process, the system will reduce manual labor, improve
accuracy, and enhance overall efficiency. Additionally, it will offer
customers a seamless experience by providing online booking, easy
payment options, and real-time updates on car availability.

Key Features and Functionality

The car rental system will incorporate several key features, including
customer registration and management, car inventory tracking, rental
booking and management, payment processing, and reporting.
Customers will be able to create profiles, view available cars, make
reservations, and track their rental history. The system will also
manage car inventory, including details such as make, model, year, and
availability. Financial transactions, such as payments and refunds, will
be handled securely and efficiently. Finally, the system will generate
various reports, such as rental summaries and financial statements,
to aid in business analysis and decision-making.
LIBRARY
Mysql.connector:

Mysql.connector is a lightweight relational database management


system (RDBMS) that is embedded directly into the application. It
is a popular choice for developers due to its following features:
* Self-contained: Mysql.connector databases are stored in a single
file, making them easy to deploy and manage.
* Lightweight: Mysql.connector has a small footprint and requires
minimal resources to run.
* Fast: Mysql.connector is known for its fast performance, even on
devices with limited resources.
* Reliable: Mysql.connector has a long history of stability and
reliability.
* Cross-platform: Mysql.connector can be used on a wide variety
of platforms, including Windows, macOS, Linux,
iOS, and Android.
Code:
import mysql.connector

# FUNCTIONS

# Creating connection
def connect_to_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="12345",
database="mybank"
)

# Creating tables
def create_tables():
db = connect_to_db()
cursor = db.cursor()
try:
# Creating accounts table
cursor.execute("""
CREATE TABLE IF NOT EXISTS accounts (
account_number VARCHAR(20) PRIMARY KEY,
name VARCHAR(100),
balance DOUBLE
)
""")
# Creating transactions table
cursor.execute("""
CREATE TABLE IF NOT EXISTS transactions (
id INT AUTO_INCREMENT PRIMARY KEY,
account_number VARCHAR(20),
transaction_type VARCHAR(10),
amount DECIMAL,
)
""")
db.commit()
except Exception as e:
print("Error creating tables:", e)
finally:
cursor.close()
db.close()

# Creating accounts function


def create_account(account_number, name, balance):
db = connect_to_db()
cursor = db.cursor()
try:
cursor.execute(
"INSERT INTO accounts (account_number, name, balance) VALUES (%s, %s,
%s)",
(account_number, name, balance)
)
db.commit()
print("Account Created!")
except Exception as e:
print("Error:", e)
finally:
cursor.close()
db.close()

# Creating deposits function


def deposit(account_number, amount):
db = connect_to_db()
cursor = db.cursor()
try:
cursor.execute(
"UPDATE accounts SET balance = balance + %s WHERE account_number =
%s",
(amount, account_number)
)
if cursor.rowcount > 0:
cursor.execute(
"INSERT INTO transactions (account_number, transaction_type, amount)
VALUES (%s, %s, %s)",
(account_number, "Deposit", amount)
)
db.commit()
print("Deposit successful!")
else:
print("Account not found.")
except Exception as e:
print("Error:", e)
finally:
cursor.close()
db.close()

# Creating withdrawal function


def withdraw(account_number, amount):
db = connect_to_db()
cursor = db.cursor()
try:
cursor.execute(
"SELECT balance FROM accounts WHERE account_number = %s",
(account_number,)
)
result = cursor.fetchone()
if result and result[0] >= amount:
cursor.execute(
"UPDATE accounts SET balance = balance - %s WHERE account_number =
%s",
(amount, account_number)
)
cursor.execute(
"INSERT INTO transactions (account_number, transaction_type, amount)
VALUES (%s, %s, %s)",
(account_number, "Withdraw", amount)
)
db.commit()
print("Withdrawal successful!")
elif result:
print("Insufficient balance.")
else:
print("Account not found.")
except Exception as e:
print("Error:", e)
finally:
cursor.close()
db.close()

# Exit function
def exit_program():
print("Thanks for using Kar Banking System. Goodbye!")
exit()

# Creating menu function


def display_menu():
print("\nWhat would you like to do today?")
print("1. Create Account")
print("2. Deposit Money")
print("3. Withdraw Money")
print("4. Display Account Details")
print("5. Display All Transactions")
print("6. Exit")

#MAIN PROGRAM
print()
print(" $$$ <==== Welcome to Kn Banking System! ====> $$$")
print()

while True:
display_menu()
try:
choice = int(input("Enter your choice (1-6): "))
if choice == 1:
account_number = input("Enter Account Number: ")
name = input("Enter Name: ")
balance = float(input("Enter Initial Balance: "))
create_account(account_number, name, balance)
elif choice == 2:
account_number = input("Enter Account Number: ")
amount = float(input("Enter Amount to Deposit: "))
deposit(account_number, amount)
elif choice == 3:
account_number = input("Enter Account Number: ")
amount = float(input("Enter Amount to Withdraw: "))
withdraw(account_number, amount)
elif choice == 4:
account_number = input("Enter Account Number: ")
db = connect_to_db()
cursor = db.cursor()
try:
cursor.execute(
"SELECT * FROM accounts WHERE account_number = %s",
(account_number,)
)
account = cursor.fetchone()
if account:
print("\nAccount Details:")
print(f"Account Number: {account[0]}")
print(f"Name: {account[1]}")
print(f"Balance: {account[2]}")
else:
print("Account not found.")
except Exception as e:
print("Error:", e)
finally:
cursor.close()
db.close()
elif choice == 5:
account_number = input("Enter Account Number: ")
db = connect_to_db()
cursor = db.cursor()
try:
cursor.execute(
"SELECT * FROM transactions WHERE account_number = %s",
(account_number,)
)
transactions = cursor.fetchall()
if transactions:
print("\nTransaction History:")
for transaction in transactions:
print(
f"ID: {transaction[0]}, Type: {transaction[2]}, Amount: {transaction[3]}"
)
else:
print("No transactions found for this account.")
except Exception as e:
print("Error:", e)
finally:
cursor.close()
db.close()
elif choice == 6:
exit_program()

else:
print("Please choose a valid option (1-6).")
except Exception:
print("Invalid input! Please enter a valid number.")
Examples:
Improvements and Suggestions:

1. Error Handling for Inputs:


Currently, you're converting registration numbers and rents
to integers (e.g., int(reg)), which could raise an error if non-
numeric input is provided. Consider using try-except to catch
invalid inputs and show a friendly error message.
2. Validation:
You might want to validate that the car’s Registration No. is
unique before adding it to the database to prevent duplicate
entries.
3. Real-time Updates:
After adding, reserving, or returning a car, you update the
display by refreshing the Treeview. Make sure this works
seamlessly to reflect real-time changes in the data.
4. Repetitive Code:
You can refactor some of the repeated code (e.g., creating
frames, labels, and entries for forms) into separate helper
methods to reduce redundancy and improve code readability.
5. Color Function:
The clr() method is a clever way to define custom colors
using RGB values, making it easier to maintain color
consistency throughout the UI.
6. Database Connection:
o Make sure to close the database connection
(self.con.close()) after completing database
interactions, especially if an exception is raised. This
ensures you don't leave open connections.
7. Car Availability Toggle:
It might be worth adding an extra step in resFun() and
retFun() to first verify the car's availability in the database
before updating it, to ensure data integrity.
BIBLIOGRAPHY

1. Python book:
Class 11&12 Computer Science with Python.
Author name: SumitaArora

2. GITHUB

3. Google
THANK YOU

You might also like