0% found this document useful (0 votes)
15 views36 pages

Computer Project

Uploaded by

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

Computer Project

Uploaded by

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

1

2
This is to certify that JINEA SAHA , a student of class XII
I, has successfully completed the project titled
“INTEGRATED HOTEL MANAGEMENT SYSTEM” in the
Computer Lab during the Year 2023-2024 for the
A.I.S.S.C.E Computer Science Examination– 2024.
It is further certified that this project is the team work
of the Candidate.

External Examiner

Internal Examiner

DATED:

SEAL:

3
I extend my heartfelt gratitude to our Computer Science
Teacher - Mrs. Dhrita Adhya for her valuable guidance
and supervision throughout the project work. I am also
utmost indebted to all my team mates for their
encouragement, help, suggestion and readily helpful
service in the successful completion of the project.

I wish to express my sincere thanks to the Principal Mrs.


Joyoti Chaudhuri, Delhi Public School, Ruby Park for her
encouragement and for all the facilities that she provided
for this project work.

JINEA SAHA

4
SL. NO. TOPIC PAGE
NO.
1. Certificate 3
2. Acknowledgement 4
3. Hardware and software 6
requirements
4. Features of the 7-8
proposed system
5. Modules and function 9-10
used and their
purposes
6. Source Code 11-28
7. Output Screens 29-34
8. Limitations 35
9. Bibliography 36

5
Intel® Core™ i3 processor, 4300 M at
2.60 GHz.

3 GB

50 MB

64-bit operating system

Python IDLE 3.10

requires python to be in
the system’s path. Installation fails if it does not find
Python.

6
The program provides an interactive computer-
based system to the customers of a particular hotel.
The program enables the customers to avail the
various facilities offered by the hotel. It also helps
the hotel to maintain all records in a systematic
manner.

On launching the program, the user is first


authenticated and then the main menu opens
allowing the customer to choose which facility
he/she wants to avail.

a)Customer Details : The user can enter his/her


details while checking in. These details will be
stored in the hotel’s database for future reference.

b) Booking record : The user enters his/her check-in


and check-out dates which are stored in the hotel’s
database.

c) Lodging sector : The user can view the different


types of rooms in the hotel along with the charges,
7
select his preferred room and view the total room
rent.

d) Food sector : The user can view the different


combos in the hotel’s menu and their rates, make
a choice and view the bill.

e) Gaming sector : The user can view the different


games offered by the hotel and their charges per
hour, make a choice and view the gaming bill.

f) Sightseeing sector : The user can view the


different cars offered by the hotel for sightseeing
and their rent per hour, choose a car and view the
bill.

g) Display details : A customer’s details may be


displayed by entering his/her customer ID.

h) Total bill : The customer can enter his ID in order


to view his total bill.

8
PREDEFINED MODULES USED :-
 mysql.connector

USER-DEFINED FUNCTIONS AND THEIR


PURPOSES:

MYSQLconnectionCheck() : To make the python-


mysql connection and authenticate the user.

MYSQLconnection() : To check if the python-sql


connection has been established successfully.

userEntry() : Enables the user to enter their


details and stores the record in the hotel’s
database.

bookingRecord() : Accepts the check-in and


check-out dates of the user and stores it in the
database.

9
roomRent() : Allows the user to select his desired
room from the displayed choices, accepts the
number of days the user needs the room for and
prints the total room rent.

Restaurant() : Allows the user to select the


desired combo from the displayed choices,
accepts the quantity and prints the total food bill.

Gaming() : Allows the user select the desired


game from the displayed choices, accepts the
number of hours for which he/she wants to play
and prints the total gaming bill.

Sightseeing() : Allows the user to choose his


desired car for sightseeing, accepts the number of
hours he/she wants it for and displays the total
car rent.

totalAmount() : Accepts the user’s Customer ID


and name and prints the total bill of the user.

searchCustomer() : Accepts the user’s customer ID


and displays the records of the user from the
hotel’s database.

10
import mysql.connector

myConnnection =""

cursor=""

userName=""

password =""

roomrent =0

restaurantbill=0

gamingbill=0

carbill=0

totalAmount=0

cid=""

print("\n~~~~~~~~~~~~~~~~~~~ WELCOME TO THE EXOTICA

GRAND - KOLKATA ~~~~~~~~~~~~~~~~~~~~~~~~")

def MYSQLconnectionCheck ():

global myConnection

global userName

global password

userName = input("\n ENTER MYSQL SERVER'S USERNAME : ")

password = input("\n ENTER MYSQL SERVER'S PASSWORD : ")

11
myConnection=mysql.connector.connect(host="localhost",user=userN

ame,passwd=password , auth_plugin='mysql_native_password' )

if myConnection:

print("\n CONGRATULATIONS ! YOUR MYSQL CONNECTION


HAS BEEN ESTABLISHED !")
cursor=myConnection.cursor()

cursor.execute("CREATE DATABASE IF NOT EXISTS HMS")

myConnection.commit()

cursor.close()

return myConnection

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION

CHECK USERNAME AND PASSWORD !")

def MYSQLconnection ():

global userName

global password

global myConnection

global cid

myConnection=mysql.connector.connect(host="localhost",user=user

Name,passwd=password ,

database="HMS" , auth_plugin='mysql_native_password' )

if myConnection:

return myConnection

12
else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

myConnection.close()

def userEntry():

global cid

if myConnection:

cursor=myConnection.cursor()

createTable ="CREATE TABLE IF NOT EXISTS C_DETAILS(CID

VARCHAR(20) PRIMARY KEY,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)

print("----------------------------------------------------------------------------------------")

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()

13
print("\nNew Customer Entered In The System Successfully.

ENJOY YOUR STAY IN THE CITY OF JOY!!!")

print("----------------------------------------------------------------------------------------")

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)

print()

print("----------------------------------------------------------------------------------------")

checkin=input("\n Enter Customer CheckIN Date [ YYYY-MM-

DD ] : ")

checkout=input("\n Enter Customer CheckOUT Date [ YYYY-

MM-DD ] : ")

sql= "INSERT INTO BOOKING_RECORD VALUES(%s,%s,%s)"

values= (cid,checkin,checkout)

cursor.execute(sql,values)

14
myConnection.commit()

print("\nCHECK-IN AND CHECK-OUT ENTRY MADE

SUCCESSFULLY !")

print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

def roomRent():

global cid

customer=searchCustomer()

if customer:

global roomrent

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()

print("----------------------------------------------------------------------------------------")

print ("\n *---* We have The Following Rooms For You *---*")

print (" 1. Ultra Royal ----> Rs. 10000 ")

print (" 2. Royal ----> Rs. 5000 ")

print (" 3. Elite ----> Rs. 3500 ")

print (" 4. Budget ----> Rs. 2500 ")

15
print()

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

print("\nUltra Royal Room Rent : ", roomrent)

elif roomchoice==2:

roomrent = noofdays * 5000

print("\nRoyal Room Rent : ",roomrent)

elif roomchoice==3:

roomrent = noofdays * 3500

print("\nElite Royal Room Rent : ",roomrent)

elif roomchoice==4:

roomrent = noofdays * 2500

print("\nBudget Room Rent : ",roomrent)

else:

print("Sorry, Wrong Input, Please Try Again !!! ")

sql= "INSERT INTO ROOM_RENT VALUES(%s,%s,%s,%s,%s)"

values= (cid, roomchoice, noofdays, roomno, roomrent)

cursor.execute(sql,values)

myConnection.commit()

print("Thank You , Your Room Has Been Booked For :

",noofdays , " Days" )

print("Your Total Room Rent is : Rs. ",roomrent)

16
print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

def Restaurant():

global cid

customer=searchCustomer()

if customer:

global restaurantbill

if myConnection:

cursor=myConnection.cursor()

createTable ="CREATE TABLE IF NOT EXISTS

RESTAURENT(CID VARCHAR(20),CUISINE

VARCHAR(30),QUANTITY VARCHAR(30),BILL VARCHAR(30))"

cursor.execute(createTable)

print()

print("----------------------------------------------------------------------------------------")

print(" WELCOME TO OUR EXOTIC REASTAURANT. HERE

IS THE MENU : ")

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 Choice : "))

quantity=int(input("Enter Quantity : "))

17
if choice_dish==1:

print("\nYOU HAVE ORDERED: Vegetarian Combo ")

restaurantbill = quantity * 300

elif choice_dish==2:

print("\nYOU HAVE ORDERED: Non-Vegetarian Combo ")

restaurantbill = quantity * 500

elif choice_dish==3:

print("\nYOU HAVE ORDERED: Vegetarian & Non-

Vegetarian Combo ")

restaurantbill= quantity * 750

else:

print("Sorry, Wrong Input, Please Try Again !!! ")

sql= "INSERT INTO RESTAURENT VALUES(%s,%s,%s,%s)"

values= (cid,choice_dish,quantity,restaurantbill)

cursor.execute(sql,values)

myConnection.commit()

print("Your Total Bill Amount Is : Rs. ",restaurantbill)

print("\n\n**** ENJOY YOUR MEAL ****\n\n" )

print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

18
def Gaming():

global cid

customer=searchCustomer()

if customer:

global gamingbill

if myConnection:

cursor=myConnection.cursor()

createTable ="CREATE TABLE IF NOT EXISTS GAMING(CID

VARCHAR(20),GAMES VARCHAR(30),HOURS

VARCHAR(30),GAMING_BILL VARCHAR(30))"

cursor.execute(createTable)

print()

print("----------------------------------------------------------------------------------------")

print("^_^_^_^_^--WELCOME TO OUR GAMING SECTOR--

^_^_^_^_^")

print("""

1. Table Tennis -----> 150 Rs./HR

2. Bowling -----> 100 Rs./HR

3. Snooker -----> 250 Rs./HR

4. VR World Gaming -----> 400 Rs./HR

5. Video Games -----> 300 Rs./HR

6. Swimming Pool Games -----> 350 Rs./HR

7. Exit

""")

print()

19
game=int(input("Enter Which Game You Want To Play : "))

hour=int(input("Enter No Of Hours You Want To Play : "))

print()

if game==1:

print("YOU HAVE SELECTED TO PLAY : Table Tennis")

gamingbill = hour * 150

elif game==2:

print("YOU HAVE SELECTED TO PLAY : Bowling")

gamingbill = hour * 100

elif game==3:

print("YOU HAVE SELECTED TO PLAY : Snooker")

gamingbill = hour * 250

elif game==4:

print("YOU HAVE SELECTED TO PLAY : VR World Gaming")

gamingbill = hour * 400

elif game==5:

print("YOU HAVE SELECTED TO PLAY : Video Games")

gamingbill = hour * 300

elif game ==6:

print("YOU HAVE SELECTED TO PLAY : Swimming Pool

Games")

20
gamingbill = hour * 350

else:

print("Sorry, Wrong Input, Please Try Again !!! ")

sql= "INSERT INTO GAMING VALUES (%s,%s,%s,%s)"

values= (cid,game,hour,gamingbill)

cursor.execute(sql,values)

myConnection.commit()

print("Your Total Gaming Bill Is : Rs. ",gamingbill)

print("FOR : ",hour," HOURS","\n *** GET...SET...PLAY!!! ***")

print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("ERROR ESTABLISHING MYSQL CONNECTION !")

def Sightseeing():

global cid

customer=searchCustomer()

if customer:

global carbill

if myConnection:

cursor=myConnection.cursor()

21
createTable ="CREATE TABLE IF NOT EXISTS

SIGHTSEEING(CID VARCHAR(20),CAR VARCHAR(30), HOURS

VARCHAR(30),CARBILL VARCHAR(30))"

cursor.execute(createTable)

print()

print("----------------------------------------------------------------------------------------")

print("""

1. Swift Dzire -----> Rs. 300/hr

2. Toyota Fortuner -----> Rs.400/hr

3. Innova Crysta -----> Rs. 500/hr

4. Kia Seltos -----> Rs. 700/hr

5. Volkswagen Virtus -----> Rs. 850/hr

""")

car=int(input("Enter the car you want: "))

hr=int(input("For how many hours do you want to rent it ? "))

if car==1:

print("\nSwift Dzire")

carbill = hr*300

elif car==2:

print("\nToyota Fortuner")

carbill = hr*400

elif car==3:

print("\nInnova Crysta")

carbill = hr*500

elif car==4:

print("\nKia Seltos")

22
carbill = hr*700

elif car==5:

print("\nVolkswagen Virtus")

carbill = hr*850

else:

print("Sorry ,May Be You Are Giving Me Wrong Input,

Please Try Again !!! ")

sql= "INSERT INTO SIGHTSEEING VALUES(%s,%s,%s,%s)"

values= (cid,car,hr,carbill)

cursor.execute(sql,values)

myConnection.commit()

print("\n\n###########################################

######")

print("\nYOUR SELECTED CAR : ",car,"\nNUMBER OF

HOURS RENTED : ",hr," HOURS","\nHOPE YOU ENJOY A SAFE

TOUR!!!" )

print("\nYour Total Bill Is : ",carbill)

print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

23
def totalAmount():

global cid

customer=searchCustomer()

if customer:

global grandTotal

global roomrent

global restaurantbill

global carbill

global gamingbill

if myConnection:

cursor=myConnection.cursor()

createTable ="""CREATE TABLE IF NOT EXISTS

TOTAL(CID VARCHAR(20),C_NAME VARCHAR(30),ROOMRENT

INT ,RESTAURANTBILL INT ,GAMINGBILL INT,CARBILL

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 + restaurantbill + carbill + gamingbill

values= (cid,name,roomrent,restaurantbill ,

gamingbill,carbill,grandTotal)

cursor.execute(sql,values)

myConnection.commit()

cursor.close()

print()

24
print("----------------------------------------------------------------------------------------")

print("\n *^*^*^* THE EXOTICA GRAND - KOLKATA

*^*^*^*")

print("\n ------- PAYMENT GATEWAY ------")

print("\n CUSTOMER NAME : " ,name)

print("\nROOM RENT : Rs. ",roomrent)

print("\nRESTAURENT BILL : Rs. ",restaurantbill)

print("\nSIGHTSEEING BILL : Rs. ",carbill)

print("\nGAMING BILL : Rs. ",gamingbill)

print("___________________________________________________")

print("\nTOTAL AMOUNT : Rs. ",grandTotal)

print("\n#-#-#-#---WE HOPE YOU ENJOYED YOUR STAY---#-

#-#-#")

print("----------------------------------------------------------------------------------------")

cursor.close()

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

def searchCustomer():

global cid

if myConnection:

cursor=myConnection.cursor()

cid=input("ENTER CUSTOMER ID : ")

25
sql="SELECT * FROM C_DETAILS WHERE CID= %s"

cursor.execute(sql,(cid,))

data=cursor.fetchall()

print()

print("----------------------------------------------------------------------------------------")

if data:

for i in data:

print(i,end="")

print()

print("----------------------------------------------------------------------------------------")

return True

else:

print("Record Not Found Try Again !")

return False

cursor.close()

else:

print("\nSomthing Went Wrong ,Please Try Again !")

myConnection = MYSQLconnectionCheck ()

if myConnection:

MYSQLconnection ()

while(True):

print()

print("----------------------------------------------------------------------------------------")

26
print("""

1--->Enter Customer Details

2--->Booking Record

3--->Lodging Sector and bill

4--->Restaurant menu and bill

5--->Gaming sector and bill

6--->Car rental for sightseeing and bill

7--->Display Customer Details

8--->GENERATE TOTAL BILL AMOUNT

9--->EXIT """)

print("----------------------------------------------------------------------------------------")

choice = int(input("Enter Your Choice : "))

if choice == 1:

userEntry()

elif choice ==2:

bookingRecord()

elif choice ==3:

roomRent()

elif choice ==4:

Restaurant()

elif choice ==5:

Gaming()

elif choice ==6:

Sightseeing()

elif choice ==7:

searchCustomer()

27
elif choice ==8:

totalAmount()

elif choice ==9:

break

else:

print("Sorry, Wrong Input, Please Try Again !!! ")

else:

print("\nERROR ESTABLISHING MYSQL CONNECTION !")

28
29
CHOICES DISPLAYED :

STORING CUSTOMER DETAILS :

30
STORING BOOKING RECORDS :

LODGING SECTOR :

31
FOOD SECTOR :

GAMING SECTOR :

32
CAR RENTAL FOR SIGHTSEEING :

33
PAYMENT GATEWAY :

ENTER 9 TO EXIT :

34
It does not provide the customer a visual
representation of the various services offered by
the hotel.

It is not fully specialized and can be further


improved by adding more modules.

The system does not include Calendar bookings


yet.

The system does not allow refund requests as of


now.

The software can only be accessed from the


computer in which the code snippet is present.

35
Computer Science for class XII by Sumita
Arora

www.Stackoverflow.com
www.Geeksforgeeks.org

36

You might also like