Computer Project Report
Computer Project Report
SYSTEM
NAME:
REGISTRATION NUMBER:
INDEX
Sr No. Topic Page No.
1 Acknowledgement 3
2 Aim 4
3 Overview 5
4 Synopsis 6
5 Tables in Database 7
6 Requirements 8
7 Source code 9
8 Output 26
9 Conclusion 32
10 Bibliography 33
ACKNOWLEDGMENT
I am deeply grateful to everyone who supported and guided me during the development of this
project, helping make it a fruitful and rewarding journey.
First and foremost, I would like to express my sincere appreciation to my teacher, Ms. Sumitha
Suresh, for her unwavering guidance, encouragement, and mentorship throughout the project.
Her constructive feedback, insightful suggestions, and continuous support were instrumental in
overcoming challenges and achieving milestones during the process.
I extend my heartfelt gratitude to Mr. Suresh Balakrishnan, the Principal of Private International
English School, and the esteemed School Management, for providing the essential facilities and
creating an enabling environment that allowed me to focus on and complete this project
successfully. Their trust and encouragement were pivotal in giving me the confidence to move
forward.
A special acknowledgment goes to my family for their boundless love, unwavering support, and
motivation. Their faith in my abilities inspired me to push my boundaries and strive for
excellence in every aspect of this project. They have been my constant source of strength and
encouragement.
I would also like to thank my peers and friends who stood by me, offering cooperation,
companionship, and collaboration throughout the journey. Their teamwork, dedication, and
shared vision greatly contributed to the success of this project, making the experience both
enjoyable and enriching.
AIM
The aim of this project is to develop a functional Banking System that simulates key banking
operations in a secure and user-friendly environment.
The system will enable users to perform fundamental tasks such as account creation, secure login
authentication, fund transfers, simple interest calculations, loan management, and access to
account statements. By integrating these features, the project aims to provide hands-on
experience of banking processes while demonstrating the practical application of programming
and computational concepts.
A banking system is an integral part of modern financial infrastructure, enabling individuals and
organizations to manage their finances securely and efficiently. It provides various services,
including account management, fund transfers, loan processing, and financial reporting, making
it essential for facilitating economic activities and promoting financial literacy. Modern banking
systems emphasize automation, security, and user convenience, leveraging technology to
streamline processes and enhance accessibility.
This project aims to replicate these core functionalities in a simplified yet functional manner to
provide a practical understanding of banking operations.
OVERVIEW
Python is a high-level, interpreted programming language renowned for its readability and
simplicity. Its clear syntax makes it an excellent choice for beginners, while its versatility allows
experienced developers to use it across various domains. Python supports multiple programming
paradigms, including procedural, object-oriented, and functional programming, which adds to its
flexibility. The language boasts a rich ecosystem filled with libraries and frameworks such as
NumPy, pandas, Django, and Flask, which facilitate everything from data analysis to web
development. Moreover, Python benefits from a large and active community that contributes
extensive resources, documentation, and third-party modules, making it easier for users to find
help and enhance their projects.
On the other hand, SQL (Structured Query Language) is a standardized language specifically
designed for managing and manipulating relational databases. It provides a powerful way to
interact with data stored in tables, allowing users to perform a range of operations such as
querying data, updating records, and creating or modifying database structures. SQL is a
declarative language, meaning it focuses on what data to retrieve or manipulate rather than
detailing the steps to do so, making it user-friendly and efficient. Key commands in SQL include
SELECT, INSERT, UPDATE, DELETE, and CREATE TABLE, among others. These
commands enable users to easily manage and maintain data integrity within their databases.
In summary, both Python and SQL are essential tools in the programming and data management
landscape. Python’s versatility lends itself to a wide array of applications, from web
development to data science, while SQL remains fundamental for effective database
management. Together, they complement each other exceptionally well, especially in data-driven
projects where Python can be employed to analyze and visualize data sourced from SQL
databases. This combination empowers developers to create robust, data-centric applications and
solutions.
SYNOPSIS
This project integrates Python and SQL to create a dynamic and efficient data management and
analysis system. The project involves designing a system where Python scripts interact with an
SQL database to perform various operations such as data insertion, querying, updating, and
deletion.
User Authentication:
Username and Password for secure login.
Multiple Account Types and Account Creation:
Savings Account: Includes Simple Interest Calculation.
Checking Account: Allows basic deposit and withdrawal functions without interest.
Simple Interest Calculation:
View interest accumulated over time.
Applies to Savings accounts only.
Withdrawal limit for the number of times per month.
Basic Fund Transfer:
Transfer funds within the same user account (self-transfer option).
Transfer funds between different user accounts.
Loan Management:
Loan Applications: Users can apply for loans with different conditions and interest
rates.
Loan Repayment: Manual repayment option for users, with tracking by the system.
Account Statement:
Users can view a complete transaction history of processed transactions.
Tables in Database
REQUIREMENTS
Software Requirements:
1)Windows 10 or higher
2)MySQL
3)Python
4)MySQL connector
Hardware Requirements:
1)Laptop/Computer
2)Keyboard
import mysql.connector
import datetime
def create_connection():
try:
connection = mysql.connector.connect(
host="localhost",
# database="banking_system",
database="test_banking",
user="root",
password="mysql",
port=3307
if connection.is_connected():
return connection
except Error as e:
print(f"Error: '{e}'")
return None
def register_user(connection, username, password):
cursor = connection.cursor()
try:
cursor.execute(
(username, password),
connection.commit()
except Error as e:
print(f"Error: '{e}'")
cursor = connection.cursor()
cursor.execute(
user = cursor.fetchone()
if user:
print("Login successful!")
return user
else:
print("Login failed!")
return None
cursor = connection.cursor()
cursor.execute(
connection.commit()
cursor = connection.cursor()
cursor.execute(
cursor.execute(
connection.commit()
print("Deposit successful!")
cursor = connection.cursor()
balance = cursor.fetchone()
if balance:
balance = balance[0]
else:
return
cursor.execute(
(amount, account_id),
# today = datetime.date.today().isoformat()
# print(today)
cursor.execute(
"INSERT INTO Transactions (user_id, account_id,
transaction_type, amount, transaction_date) VALUES (%s, %s,
'withdrawal', %s, now())",
connection.commit()
print("Withdrawal successful!")
return True
else:
print("Insufficient balance!")
return False
cursor = connection.cursor()
cursor.execute(
(account_id,),
if account_type != "savings":
return
today = datetime.date.today()
cursor.execute(
connection.commit()
else:
cursor = connection.cursor()
cursor.execute(
connection.commit()
cursor = connection.cursor()
query = """
"""
cursor.execute(query, (loan_id, ))
loan_amount = cursor.fetchone()[0]
is_active = "True"
is_active = "False"
cursor.execute(
connection.commit()
print("Repayment Failed")
cursor = connection.cursor()
transactions = cursor.fetchall()
if not transactions:
return
print(f'{transaction[2]:<10} {transaction[3]:<16}
{transaction[4]:<8} {str(transaction[5])[:-9]}')
cursor = connection.cursor()
query = """
"""
cursor.execute(query, (user_id, ))
active_loans = cursor.fetchall()
if active_loans:
print("\nYour Loans:")
loan
print(f"loan_period: {loan_period}")
print("-" * 30)
else:
return active_loans
cursor = connection.cursor()
query = """
FROM Accounts
WHERE user_id = %s
"""
cursor.execute(query, (user_id,))
accounts = cursor.fetchall()
if accounts:
print("\nYour Accounts:")
account
print(f"Balance: ${balance:.2f}")
print("-" * 30)
else:
return accounts
def setup_database(connection):
query = """
);
user_id INT,
last_interest_date DATE,
);
transaction_type VARCHAR(50),
);
user_id INT,
);
"""
cursor = connection.cursor()
cursor.execute("show tables")
existing_tables = cursor.fetchall()
if not existing_tables:
cursor.execute(query)
def main():
connection = create_connection()
if not connection:
return
setup_database(connection)
while True:
print("1. Register")
print("2. Login")
print("3. Exit")
if choice == "1":
if user:
user_menu(connection, user)
elif choice == "3":
print("Exiting...")
break
else:
connection.close()
should_exit = False
try:
print("\nUser Menu")
print("2. Deposit")
print("3. Withdraw")
if choice == "1":
transfer_funds(connection, user[0],
from_account_id, to_account_id, amount)
repay_loan(connection, loan_id,
repay_from_account_id, amount, user[0])
view_statement(connection, account_id)
get_all_accounts(connection, user[0])
get_all_active_loans(connection, user[0])
calculate_interest(connection, account_id)
print("Logging out...")
should_exit = True
else:
except:
user_menu(connection, user)
if __name__ == "__main__":
main()
OUTPUT
1. Registering a new user account
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 1
Enter account type (savings/checkings): savings
Savings account created successfully!
b. Checkings
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 1
Enter account type (savings/checkings): checkings
Checkings account created successfully!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 8
Your Accounts:
Account ID: 7
Account Type: Savings
Balance: $0.00
Interest Rate: 3.50% per annum
Last Interest Date: 2024-11-16
------------------------------
Account ID: 8
Account Type: Checkings
Balance: $0.00
Interest Rate: 0.00% per annum
Last Interest Date: 2024-11-16
------------------------------
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 2
Enter account ID: 7
Enter amount to deposit: 10000
Deposit successful!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 3
Enter account ID: 7
Enter amount to withdraw: 1000
Withdrawal successful!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 4
Enter your account ID: 7
Enter recipient account ID: 8
Enter amount to transfer: 1000
Withdrawal successful!
Deposit successful!
Funds transferred successfully!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 5
Enter loan amount: 100000
Enter interest rate: 2.5
Enter loan period (in months): 36
Loan application successful!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 9
Your Loans:
Loan ID: 5
Loan Amount: $107500.00
Interest Rate: 2.50% per annum
loan_period: 36
------------------------------
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 6
Enter loan ID: 5
Enter account to repay from: 7
Enter amount to repay: 500
Withdrawal successful!
Loan repayment successful!
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 7
Enter account ID: 7
Account ID Transaction Type Amount Transaction Date
7 deposit 10000.00 2024-11-16
7 withdrawal 1000.00 2024-11-16
7 withdrawal 1000.00 2024-11-16
7 withdrawal 500.00 2024-11-16
12. Calculate and get interest for a savings account:
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 10
Enter account ID: 7
Interest calculated: 2.16
User Menu
1. Create Account
2. Deposit
3. Withdraw
4. Transfer Funds
5. Apply for Loan
6. Repay Loan
7. View Account Statement
8. View All Accounts
9. View All Loans
10. Calculate Interest
11. Logout
Choose an option: 11
Logging out...
CONCLUSION
The banking system project successfully integrates and implements all the necessary features for
efficient banking operations. It covers essential functionalities such as user account management,
transaction processing, and secure data handling, ensuring smooth interaction and reliability.
Key components like account creation, balance checking, and transaction recording are
effectively implemented, providing a seamless experience for users. The system ensures security
through user authentication, safeguarding both customer data and transaction integrity.
This project lays a strong foundation for future expansion, allowing additional features like loan
processing or investment management to be added with ease. Overall, the system meets the core
requirements of modern banking, delivering a secure, efficient, and user-friendly solution.
BIBLIOGRAPHY
“Computer Science with Python.” Sumitha Arora, 1st Edition, Dhanpat Rai
Publications, 2021.
“Computer Science 50: Introduction to Python.” Harvard University, CS50p.
“MySQL Documentation.” MySQL. https://dev.mysql.com/doc/.
“Python Official Documentation.” Python Software Foundation.
https://docs.python.org/.