Computer Science Project Report
Hotel management system
BY: Riddhi Krishna Rajesh, Sreya Vithayathil Biju, Sreerudra
Raghu.
Certificate
This is to certify that..... of Grade XII ...... Registration
No.......................................has successfully completed his/her
Computer Science Practical during the academic year 2024-2025
for the AISSCE as prescribed by CENTRAL BOARD OF
SECONDARY EDUCATION, New Delhi, India.
Date of Examination:........../........../2025
Signature of Internal Examiner Signature of External
Examiner
Acknowledgements
We would like to express our sincere gratitude to everyone
who supported us in completing this computer science
project.
First and foremost, we are deeply grateful to Ms. Babitha for
providing guidance and valuable feedback throughout the
project.
We further thank to all the staff members of Amity Private
School Sharjah. We owe our sincere gratitude towards our
classmates for their collaborative spirit and teamwork.
Our heartfelt thanks to CBSE.
We also express our deepest gratitude to our parents.
Finally, we would like to wind up by paying our heartfelt
thanks to all our near and dear ones.
Index
1. Introduction of the Project.
2. System Requirements of the Project.
3. Python Coding.
4. Output of the Project.
5. References.
Introduction of the Project
We the students of CLASS XII of Amity Private School Sharjah have been
assigned the work of HOTEL MANAGEMENT SYSTEM.
To perform this task the students were divided into the group of 3 students
named as RIDDHI, SREYA and SREERUDRA
RIDDHI, SREYA and SREERUDRA has been assigned the work of coding and
programming RIDDHI and SREERUDRA have been assigned the work of
analyzing the overall mistakes and have done the conclusion work.
The project starts with –
Enter 1 - CUSTOMER DETAILS
Enter 2 - BOOKING RECORD
Enter 3 - ROOM RENT
Enter 4 - RESTAURENT BILL
Enter 5 - GAMING BILL
Enter 6 - FASHION STORE BILL
Enter 7 - DISPLAY CUSTOMER DETAILS
Enter 8 - TOTAL BILL
Enter 9 - OLD BILL
Enter 10- EXIT
PROCESS
FIRSTLY, we have done the planning in a paper work regarding what have to do
on the assigned project HOTEL MANAGEMENT SYSTEM.
SECONDLY, we discussed our planning with our subject teacher and then she
provided us the right path to perform the work.
NEXT, we started our project on foot paths of our subject teacher.
THEN, we started our coding.
NEXT, we analyzed the mistakes done and then we corrected them. THEN, we
prepared the project format as shown above.
............
System Requirements of the Project
Recommended System Requirements
Processors: Intel® CoreTM i3 processor 4300M at 2.60 GHz. Disk space: 2 to 4
GB.
Operating systems: Windows® 10, MACOS, and UBUNTU. Python Versions:
3.X.X or Higher.
Minimum System Requirements
Processors: Intel Atom® processor or Intel® CoreTM i3 processor. Disk space: 1
GB.
Operating systems: Windows 7 or later, MACOS, and UBUNTU. Python
Versions: 2.7.X, 3.6.X.
Prerequisites before installing MySQL Connector Python
You need root or administrator privileges to perform the installation process.
Python must be installed on your machine.
Note: – MySQL Connector Python requires python to be in the system’s PATH.
Installation fails if it doesn’t find Python.
On Windows, If Python doesn’t exist in the system’s PATH, please manually
add the directory containing python.exe yourself.
PYTHON CODING
import mysql.connector
myConnection = ""
cursor = ""
userName = ""
password = ""
roomrent = 0
restaurentbill = 0
gamingbill = 0
fashionbill = 0
totalAmount = 0
cid = ""
def userEntry():
global cid
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS C_DETAILS(
CID VARCHAR(20),
C_NAME VARCHAR(30),
C_ADDRESS VARCHAR(30),
C_AGE VARCHAR(30),
C_COUNTRY VARCHAR(30),
P_NO VARCHAR(30),
C_EMAIL VARCHAR(30)
)"""
cursor.execute(createTable)
cid = input("Enter Customer Identification Number: ")
name = input("Enter Customer Name: ")
address = input("Enter Customer Address: ")
age = input("Enter Customer Age: ")
nationality = input("Enter Customer Country: ")
phoneno = input("Enter Customer Contact Number: ")
email = input("Enter Customer Email: ")
sql = "INSERT INTO C_DETAILS VALUES (%s, %s, %s, %s, %s, %s, %s)"
values = (cid, name, address, age, nationality, phoneno, email)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("\nNew Customer Entered In The System Successfully!")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def bookingRecord():
global cid
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS BOOKING_RECORD(
CID VARCHAR(20),
CHECK_IN DATE,
CHECK_OUT DATE
)"""
cursor.execute(createTable)
checkin = input("\nEnter Customer CheckIN Date [YYYY-MM-DD]: ")
checkout = input("\nEnter Customer CheckOUT Date [YYYY-MM-DD]: ")
sql = "INSERT INTO BOOKING_RECORD VALUES (%s, %s, %s)"
values = (cid, checkin, checkout)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("\nCHECK-IN AND CHECK-OUT ENTRY MADE SUCCESSFULLY!")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def roomRent():
global cid, roomrent
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS ROOM_RENT(
CID VARCHAR(20),
ROOM_CHOICE INT,
NO_OF_DAYS INT,
ROOMNO INT,
ROOMRENT INT
)"""
cursor.execute(createTable)
print("\n##### We have The Following Rooms For You #####")
print("1. Ultra Royal ----> 10000 Rs.")
print("2. Royal ----> 5000 Rs.")
print("3. Elite ----> 3500 Rs.")
print("4. Budget ----> 2500 Rs.")
roomchoice = int(input("Enter Your Option: "))
roomno = int(input("Enter Customer Room No: "))
noofdays = int(input("Enter No. Of Days: "))
if roomchoice == 1:
roomrent = noofdays * 10000
elif roomchoice == 2:
roomrent = noofdays * 5000
elif roomchoice == 3:
roomrent = noofdays * 3500
elif roomchoice == 4:
roomrent = noofdays * 2500
else:
print("Sorry you may be giving wrong input, please try again")
return
sql = "INSERT INTO ROOM_RENT VALUES (%s, %s, %s, %s, %s)"
values = (cid, roomchoice, noofdays, roomno, roomrent)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("Thank you, your room has been booked for: ", noofdays, "days")
print("Your Total Room Rent is: Rs.", roomrent)
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def Restaurent():
global cid, restaurentbill
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS RESTAURENT(
CID VARCHAR(20),
CUISINE VARCHAR(30),
QUANTITY INT,
BILL INT
)"""
cursor.execute(createTable)
print("1. Vegetarian Combo -----> 300 Rs.")
print("2. Non-Vegetarian Combo -----> 500 Rs.")
print("3. Vegetarian & Non-Vegetarian Combo -----> 750 Rs.")
choice_dish = int(input("Enter Your Cuisine: "))
quantity = int(input("Enter Quantity: "))
if choice_dish == 1:
restaurentbill = quantity * 300
elif choice_dish == 2:
restaurentbill = quantity * 500
elif choice_dish == 3:
restaurentbill = quantity * 750
else:
print("Sorry you may be giving wrong input, please try again")
return
sql = "INSERT INTO RESTAURENT VALUES (%s, %s, %s, %s)"
values = (cid, choice_dish, quantity, restaurentbill)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("Your Total Bill Amount Is: Rs.", restaurentbill)
print("\n\n**** WE HOPE YOU WILL ENJOY YOUR MEAL ***\n\n")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def Gaming():
global cid, gamingbill
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS GAMING(
CID VARCHAR(20),
GAMES VARCHAR(30),
HOURS INT,
GAMING_BILL INT
)"""
cursor.execute(createTable)
print("""
1. Table Tennis ----> 200 Rs./HR
2. Bowling ----> 450 Rs./HR
3. Snooker ----> 300 Rs./HR
4. VR World Gaming -----> 400 Rs./HR
5. Video Games -----> 300 Rs./HR
6. Swimming Pool Games -----> 350 Rs./HR
""")
game = int(input("Enter What Game You Want To Play: "))
hour = int(input("Enter No Of Hours You Want To Play: "))
print("\n\n#################################################")
if game == 1:
gamingbill = hour * 200
elif game == 2:
gamingbill = hour * 450
elif game == 3:
gamingbill = hour * 300
elif game == 4:
gamingbill = hour * 400
elif game == 5:
gamingbill = hour * 300
elif game == 6:
gamingbill = hour * 350
else:
print("Sorry you may be giving wrong input, please try again")
return
sql = "INSERT INTO GAMING VALUES (%s, %s, %s, %s)"
values = (cid, game, hour, gamingbill)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("Your Total Gaming Bill Is: Rs.", gamingbill)
print("FOR: ", hour, " HOURS", "\n*** WE HOPE YOU WILL ENJOY YOUR GAME ***")
print("\n\n#################################################")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def Fashion():
global cid, fashionbill
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS FASHION(
CID VARCHAR(20),
DRESS INT,
AMOUNT INT,
BILL INT
)"""
cursor.execute(createTable)
print("""
1. Shirts -----> 1500 Rs.
2. T-Shirts -----> 300 Rs.
3. Pants -----> 2000 Rs.
4. Jeans -----> 4000 Rs.
5. Tassel top -----> 500 Rs.
6. Gown -----> 3000 Rs.
7. Western dress -----> 3000 Rs.
8. Skirts -----> 400 Rs.
9. Trousers -----> 200 Rs.
10. InnerWear -----> 30 Rs.
""")
dress = int(input("Enter your Choice of wear: "))
quantity = int(input("How many do you want to buy: "))
if dress == 1:
fashionbill = quantity * 1500
elif dress == 2:
fashionbill = quantity * 300
elif dress == 3:
fashionbill = quantity * 2000
elif dress == 4:
fashionbill = quantity * 4000
elif dress == 5:
fashionbill = quantity * 500
elif dress == 6:
fashionbill = quantity * 3000
elif dress == 7:
fashionbill = quantity * 3000
elif dress == 8:
fashionbill = quantity * 400
elif dress == 9:
fashionbill = quantity * 200
elif dress == 10:
fashionbill = quantity * 30
else:
print("Sorry you may be giving wrong input, please try again")
return
sql = "INSERT INTO FASHION VALUES (%s, %s, %s, %s)"
values = (cid, dress, quantity, fashionbill)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
print("\n\n#################################################")
print("\nYOU SELECT ITEM NO: ", dress, "\nYOUR QUANTITY IS: ", quantity, "ITEMS",
"\nTHANK YOU FOR SHOPPING, VISIT AGAIN!!!")
print("\nYour Total Bill Is: ", fashionbill)
print("\n\n#################################################")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def totalAmount():
global cid, grandTotal, roomrent, restaurentbill, fashionbill, gamingbill
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS TOTAL(
CID VARCHAR(20),
C_NAME VARCHAR(30),
ROOMRENT INT,
RESTAURENTBILL INT,
GAMINGBILL INT,
FASHIONBILL INT,
TOTALAMOUNT INT
)"""
cursor.execute(createTable)
sql = "INSERT INTO TOTAL VALUES (%s, %s, %s, %s, %s, %s, %s)"
name = input("Enter Customer Name: ")
grandTotal = roomrent + restaurentbill + fashionbill + gamingbill
values = (cid, name, roomrent, restaurentbill, gamingbill, fashionbill, grandTotal)
cursor.execute(sql, values)
myConnection.commit() # Corrected to commit the transaction
cursor.close()
print("\n**** CROWN PLAZA MIAMI **** CUSTOMER BILLING ****")
print("\nCUSTOMER NAME: ", name)
print("\nROOM RENT: Rs.", roomrent)
print("\nRESTAURENT BILL: Rs.", restaurentbill)
print("\nFASHION BILL: Rs.", fashionbill)
print("\nGAMING BILL: Rs.", gamingbill)
print("___________________________________________________")
print("\nTOTAL AMOUNT: Rs.", grandTotal)
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
def searchOldBill():
global cid
customer = searchCustomer()
if customer:
if myConnection:
cursor = myConnection.cursor()
sql = "SELECT * FROM TOTAL WHERE CID= %s"
cursor.execute(sql, (cid,))
data = cursor.fetchall()
if data:
print(data)
else:
print("Record Not Found, Try Again!")
cursor.close()
else:
print("\nSomething Went Wrong, Please Try Again!")
def searchCustomer():
global cid
if myConnection:
cursor = myConnection.cursor()
cid = input("ENTER CUSTOMER ID: ")
sql = "SELECT * FROM C_DETAILS WHERE CID= %s"
cursor.execute(sql, (cid,))
data = cursor.fetchall()
if data:
print(data)
return True
else:
print("Record Not Found, Try Again!")
return False
else:
print("\nSomething Went Wrong, Please Try Again!")
# Main Program Execution
print("***************HOTEL MANAGEMENT SYSTEM*************************")
print("*****************CROWN PLAZA MIAMI*****************************")
myConnection = MYSQLconnectionCheck()
if myConnection:
while True:
print("""
1---> Enter Customer Details
2---> Booking Record
3---> Calculate Room Rent
4---> Calculate Restaurant Bill
5---> Calculate Gaming Bill
6---> Calculate Fashion Store Bill
7---> Display Customer Details
8---> GENERATE TOTAL BILL AMOUNT
9---> GENERATE OLD BILL
10---> EXIT
""")
choice = int(input("Enter Your Choice: "))
if choice == 1:
userEntry()
elif choice == 2:
bookingRecord()
elif choice == 3:
roomRent()
elif choice == 4:
Restaurent()
elif choice == 5:
Gaming()
elif choice == 6:
Fashion()
elif choice == 7:
searchCustomer()
elif choice == 8:
totalAmount()
elif choice == 9:
searchOldBill()
elif choice == 10:
break
else:
print("Sorry you may be giving wrong input, please try again")
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION!")
bOUTPUT OF THE PROJECT
MYSQL DATABSE AND TABLES USED IN THIS PROJECT
DATABASE:
TABLE STRUCTURE 1 AND 2:
TABLE STRUCTURE 3 AND 4:
TABLE STRUCTURE 5 AND 6:
TABLE STRUCTURE 7:
BACKEND DATA: