CS Practical File
CS Practical File
January, 2023
Place : Prabhat Senior Secondary Public School
Saksham Shukla
ABSTRACT:
The ultimate motto of
this project is to help
the travelers to get all
the info about rooms
Prices, room’s
availability, food and
other necessary
information for hotel
room booking. This
project helps the users
to carry this task
online easily.
SIGNATURE SIGNATURE
EXTERNAL EXAMINER INTERNAL EXAMINER
SIGNATURE OF PRINCIPAL
ACKNOWLEDGMENT
SL.NO. TOPIC
1. CERTIFICATE
2. ACKNOWLEDEGMENT
3. INTRODUCTION TO PROJECT
4. CODING
5. OUTPUTS
6. BIBLIOGRAPHY
INTRODUCTION
My project on “HOTEL MANAGEMENT” gives idea about the
management in hotels. The package gives all the information
regarding the check in or check out facilities of customer. The
customer can made his or her booking for rooms and food
etc. It gives details of the customer and the time of arrival
and departure of customer. The package also provides the
facility of searching the customer or employee working in
that particular hotel by name/by provided Id. It gives a
detailed report of the customer and the room occupied by
him/her. This software is very useful to the departments for
managing their activities.
import mysql.connector
db=mysql.connector.connect(host='localhost',user='root',password='deepak')
mycursor=db.cursor()
mycursor.execute('create database if not exists HOTEL_MANAGEMENT')
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
print("\nDESCRIPTION:")
print("The Taj Mahal Palace, Mumbai makes a wonderful starting point from which to\
discover the charms that bring people from around the globe flocking to Mumbai city,\
India’s commercial and entertainment capital. Around the corner from the hotel is Colaba\
Causeway - a vibrant stretch filled with roadside stores, jewellery shops, pubs and\
restaurants that whisks guests back in time to old Bombay. Take a tour of and learn about\
the rich history and architecture of this vibrant city, accompanied by Government of India\
appointed and trained tourism officials.Walk past Gothic buildings and through narrow\
streets.Visit historic locations such as Wellington Fountain, Regal Cinema, Indian Merchant\
Building, Asiatic Library, CSMVS Museum, Jehangir Art Gallery, Elphinstone College and\
other prominent buildings in varying styles of architecture, each symbolic of a particular\
period of Bombay’s social and commercial history.\n")
print("BOOKING:")
print("Excursions, Guided tours, Private parties")
mycursor.close()
db.close()
# Function, hotel fare calculator
# **********************************
def hotelfarecal():
while True :
print("\n")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("1.Booking for Room")
print("2.Show Customer Record")
print("3.Search Customer Record")
print("4.Delete Customer Record")
print("5.Update Customer Record")
print("6.Return to Main Menu")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
if (b=='1'):
z='y'
while (z=='y'):
inputdata()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfarecal()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='2'):
z='y'
while z=='y':
display()
z=input("\nDo you want to continue..(y/n):")
If (z=='n'):
return hotelfarecal()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='3'):
z='y'
while (z=='y'):
search()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfarecal()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='4'):
z='y'
while (z=='y'):
delete()
if (z=='n'):
return hotelfarecal()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='5'):
z='y'
while (z=='y'):
update()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfarecal()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='6'):
break
else:
print("Invalid Input......")
# Inserting data
# ******************
import mysql.connector
import random
def inputdata():
r=0
l=0
p=0
s=0
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input("\nEnter Customer Code:")
Cname=input("Enter Customer Name:")
Cadd=input("Enter Customer Address:")
Cindate=input("Enter Customer Check in Date:")
Coutdate=input("Enter Customer Check out Date:")
Cid_type=input("Enter your Identity card name:")
Cid_no=input("Enter your Identity number:")
Ccontact_no=input("Enter you Contact number:")
CNationality=input("Enter your nationality:")
print("\n")
# Choose Room for rent
# ***********************
while (1):
if (x==1):
elif (x==2):
elif (x==4):
elif (x==5):
elif (x==6) :
break
else:
print ("\n")
SubTotal_bill=s+r+l+p
Add_charges=1800
Room_rent=s
Game_bill=p
Food_bill=r
Laudry_bill=l
GrandTotal_bill=SubTotal_bill+Add_charges
print("\nYou have to pay Rs",GrandTotal_bill)
data1=(Ccode,Cid_type,Cid_no,Cname,Ccontact_no,Cadd,Cindate,Coutdate,CNationality)
data2=(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,Room_rent,Food_bill,Laudry_bill,
Game_bill,SubTotal_bill,Add_charges,GrandTotal_bill)
mycursor.execute(cotm,data1)
mycursor.execute(rec,data2)
db.commit()
mycursor.close()
print("\nRecord Inserted.......")
db.close()
# Show Details of Customer
# ****************************
def display():
print("\n")
print("1.Display all records")
print("2.Display through code number")
d=input("\nEnter your choice:")
if (d=='1'):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database= 'HOTEL_MANAGEMENT')
mycursor=db.cursor()
qry=("select h.Ccode,h.Cname,h.Cadd,h.Cindate,h.Coutdate,h.Room_no,\
c.CNationality, c.Ccontact_no,c.Cid_type,c.Cid_no from hoteldata h, customer c\
where h.Ccode=c.Ccode")
mycursor.execute(qry)
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,CNationality, Ccontact_no,
Cid_type,Cid_no) in mycursor:
print ("\n")
print ("Customer details.......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer Id type:",Cid_type)
print ("Customer Id Number:",Cid_no)
print ("Customer address:",Cadd)
print ("customer Nationality:",CNationality)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Customer Contact number:",Ccontact_no)
print ("___________________________________")
mycursor.close()
print("\nIt's All record")
db.close()
elif (d=='2'):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input("\nEnter code of customer:")
qry=("select h.Ccode,h.Cname,h.Cadd,h.Cindate,h.Coutdate,h.Room_no,\
c.CNationality,c.Ccontact_no,c.Cid_type,c.Cid_no from hoteldata h, customer c\
where h.Ccode=c.Ccode and h.Ccode=%s")
rec_code=(Ccode,)
mycursor.execute(qry,rec_code)
rec_count=0
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,CNationality,Ccontact_no,
Cid_type,Cid_no) in mycursor:
rec_count+=1
print ('\nRecord Found......')
print ("Customer details.......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer Id type:",Cid_type)
print ("Customer Id Number:",Cid_no)
print ("Customer address:",Cadd)
print ("customer Nationality:",CNationality)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Customer Contact number:",Ccontact_no)
if (rec_count==0):
print("\nRecord not found!!")
db.commit()
mycursor.close()
db.close()
else :
print("Invalid Input!!")
# Search Customer
# *******************
def search():
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input("\nEnter Customer Code to be Searched in Hotel:")
qry=("select * from hoteldata where Ccode=%s")
rec_srch=(Ccode,)
mycursor.execute(qry,rec_srch)
rec_count=0
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,Room_rent,Food_bill,Laudry_bill,
Game_bill,SubTotal_bill,Add_charges,GrandTotal_bill) in mycursor:
rec_count+=1
print ('\nRecord Found')
print ("Customer details......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer address:",Cadd)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Room rent is:",Room_rent)
print ("Food bill is:",Food_bill)
print ("Laundary bill is:",Laudry_bill)
print ("Game bill is:",Game_bill)
print ("Sub total bill is:",SubTotal_bill)
print ("Additional Service Charges is:",Add_charges)
print ("Grand Total bill is:",GrandTotal_bill)
if (rec_count==0):
print("\nRecord not found!!")
db.commit()
mycursor.close()
db.close()
# Delete Customer
# *******************
def delete():
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input("\nEnter Customer Code to be delete from Hotel:")
qry=("delete from hoteldata where Ccode=%s")
qry1=("delete from customer where Ccode=%s")
del_rec=(Ccode,)
mycursor.execute(qry,del_rec)
mycursor.execute(qry1,del_rec)
rec_count=0
for Ccode in mycursor:
rec_count+=1
print("\nRecord Deleted......")
if rec_count==0:
print("\nRecord not Found!!")
print("Enter valid data")
db.commit()
mycursor.close()
db.close()
# Update Customer
# *******************
def update():
print("\nWhich Data Should be Updated......")
print("1.Customer Name:")
print("2.Customer Address")
print("3.Customer out Date")
print("4.Customer Room Number")
print("5.Customer Contact number")
c=int(input("\nSelect your Choice:"))
if (c==1):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input('\nEnter Code of Customer to be Updated:')
qry=('select * from hoteldata where Ccode=%s')
Cname=input("Enter Customer Name:")
q=('update hoteldata set Cname=%s where Ccode=%s')
data=(Cname,Ccode)
mycursor.execute(q,data)
q=('update customer set Cname=%s where Ccode=%s')
data=(Cname,Ccode)
mycursor.execute(q,data)
print('\nRecord Updated.....')
db.commit()
mycursor.close()
db.close()
elif (c==2):
db=mysql.connector.connect(host='localhost',user='root',password='deepak'
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=int(input('\nEnter Code of Customer to be Updated:'))
qry=('select * from hoteldata where Ccode=%s')
Cadd=input("Enter Customer Adrress:")
q=('update hoteldata set Cadd=%s where Ccode=%s')
data=(Cadd,Ccode)
mycursor.execute(q,data)
q=('update customer set Cadd=%s where Ccode=%s')
data=(Cadd,Ccode)
mycursor.execute(q,data)
print('\nRecord Updated.....')
db.commit()
mycursor.close()
db.close()
elif (c==3):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=int(input('\nEnter Code of Customer to be Updated:'))
qry=('select * from hoteldata where Ccode=%s')
Cindate=input("Enter Customer in Date:")
q=('update hoteldata set Cindate=%s where Ccode=%s')
data=(Cindate,Ccode)
mycursor.execute(q,data)
q=('update customer set Cindate=%s where Ccode=%s')
data=(Cindate,Ccode)
mycursor.execute(q,data)
print('\nRecord Updated.....')
db.commit()
mycursor.close()
db.close()
elif (c==4):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=int(input('\nEnter Code of Customer to be Updated:'))
qry=('select * from hoteldata where Ccode=%s')
Coutdate=input("Enter Customer out Date:")
q=('update hoteldata set Coutdate=%s where Ccode=%s')
data=(Coutdate,Ccode)
mycursor.execute(q,data)
q=('update customer set Coutdate=%s where Ccode=%s')
data=(Coutdate,Ccode)
mycursor.execute(q,data)
print('\nRecord Updated.....')
db.commit()
mycursor.close()
db.close()
elif (c==5):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=int(input('\nEnter Code of Customer to be Updated:'))
qry=('select * from customer where Ccode=%s')
Ccontact_no=input("Enter Customer Contact number:")
q=('update customer set Ccontact_no=%s where Ccode=%s')
data=(Ccontact_no,Ccode)
mycursor.execute(q,data)
print('\nRecord Updated.....')
db.commit()
mycursor.close()
db.close()
else :
print("Invalid Input!!")
print("\n\t\t\t\t\t\t\t\t ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░")
print("֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎\ ֎֎֎֎֎֎֎֎֎֎░░ WELCOME TO THE TAJ
PALACE ░░֎֎֎֎֎֎֎֎֎\ ֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎")
print("\t\t\t\t\t\t\t\t ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░")
while True:
print("\n")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("1.Speciality of your Hotel")
print("2.Customer Management")
print("3.Booking for Private Party")
print("4.EXIT")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
b=input("\nEnter your choice:")
if (b=='1'):
speciality()
elif (b=='2'):
hotelfarecal()
elif (b=='3'):
party()
elif (b=='4'):
quit()
else:
print("Wrong Choice")
Main screen of Hotel Mangemnet
Speciality of Hotel
Customer Mangement