Cs Project For Banking Management Aarav M
Cs Project For Banking Management Aarav M
BANKING
CERTIFICATE
This is to certify that Master
Aarav Mantripragada studying
in New Baldwin
International college of
standard 12th Science(CBSE)
has completed Computer
Science (python and sql)
project
Batch 2023-24
Raghu.C.
(PRINCIPAL)
ACKNOWLEDGEMENT
INDEX
# Brief overview of project
# Output screen
# Bibliography
CHARACTERISTICS OF DBMS:
. Sequential file
. Serial file
. Random file
. Text file
. Binary file
#Software Specification: -
Operating system: Windows 10/8/7
Platform : Python IDLE 3.8
Database : MySQL
Languages : Python
#Hardware specification: -
Processor: Dual core or above
Hard Disk: 40 GB
Ram : 1024MB
Advantages of project
Source Code
import os
import platform
import mysql.connector
def connect_to_database():
try:
mydb = mysql.connector.connect(
host="127.0.0.1",
user="root",
passwd="LaVoiture123!!",
database="hotel",
charset="utf8"
)
return mydb
except mysql.connector.Error as err:
print("Error connecting to the database:", err)
return None
def register_customer(mycursor):
custname = input('Enter customer number: ')
name = input('Enter name: ')
addr = input('Enter address: ')
jr_date = input('Enter date of journey: ')
source = input('Enter source: ')
destination = input('Enter destination: ')
try:
mycursor.execute(sql, values)
mycursor.connection.commit()
mydb
print("Customer information successfully added.")
except mysql.connector.Error as err:
print("Error adding customer information:", err)
def calculate_ticket_price():
print('We have the following rooms for you:-')
print('1. type First class---> Rs 6000 PN')
print('2. type Business class---> Rs 4000 PN')
print('3. type Economy class---> Rs 2000 PN')
room_types = {
'1': {'name': 'First class', 'price': 6000},
'2': {'name': 'Business class', 'price': 4000},
'3': {'name': 'Economy class', 'price': 2000}
}
if x in room_types:
room_type = room_types[x]
ticket_price = room_type['price'] * n
print(f'You have opted {room_type["name"]}.')
print(f'Your ticket charge is: Rs {ticket_price}')
def display_customer_details(mycursor):
custname = input('Enter the customer number whose details you
want to view: ')
sql = 'SELECT * FROM pdata WHERE custname = %s'
values = (custname,)
mycursor.execute(sql, values)
customer_data = mycursor.fetchone()
if customer_data:
print('Customer Details:')
print(f'Customer No: {customer_data[0]}')
print(f'Name: {customer_data[1]}')
print(f'Address: {customer_data[2]}')
print(f'Date of Journey: {customer_data[3]}')
print(f'Source: {customer_data[4]}')
print(f'Destination: {customer_data[5]}')
else:
print(f'Customer with No {custname} not found.')
def display_all_customers(mycursor):
sql = 'SELECT * FROM pdata'
mycursor.execute(sql)
all_customers = mycursor.fetchall()
def main_menu(mycursor):
while True:
print('Main Menu:')
print('1. Register Customer')
print('2. Calculate Ticket Price')
print('3. Display Customer Details')
print('4. Display All Customers')
print('5. Exit')
if choice == '1':
register_customer(mycursor)
elif choice == '2':
calculate_ticket_price()
elif choice == '3':
display_customer_details(mycursor)
elif choice == '4':
display_all_customers(mycursor)
elif choice == '5':
print('Exiting the program.')
break
else:
print('Invalid choice. Please enter a valid option.')
if __name__ == "__main__":
mydb = connect_to_database()
if mydb:
mycursor = mydb.cursor(buffered=True)
main_menu(mycursor)
mycursor.close()
mydb.close()
);
OUTPUT SCREEN
custname custno addr jr_date source destination
Aarav 1234567899 Shobha 2023-10-11 Bangalore Dubai
John 1334256760 Villa 1024 2023-09-21 Dubai USA
Sarvesh 9897967656 Villa 3425 2023-08-22 Abu-Dhabi China
BIBLIOGRAPHY
1. http://www.google.com/
2. http://en.wikipedia.org
3. Computer science with python
by Sumita Arora