COMPUTER SCIENCE Sample PROJECT
COMPUTER SCIENCE Sample PROJECT
SCIENCE
PROJECT
HOTEL MANAGEMENT SYSTEM USING
PYTHON
BY-RITUPRANGYA DASH
CLASS – XII *B*
ROLL NO-12634799
NALANDA PUBLIC SCHOOL
BHATAPADA, CUTTACK
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE
THIS IS TO CERTIFY THAT RITUPRANGYA
DASH, CLASS XII-B HAS SUCESSFULLY
COMPLETED THE RESEARCH OF THE
MENTIONED TOPIC UNDER THE GUIDANCE
OF MRS.MADHUMITA HOTA (SUBJECT
TEACHER) DURING THE YEAR 2021-2022 IN
PARTIAL FUFILMENT OF PRACTICAL
EXAMINATION
SIGNATURE OF PRINCIPAL
RITUPRANGYA DASH
Class – XII “B”
INDEX
I am so glad that this work have been assigned to me, yet i haven’t
done this work before Mrs Madhumita Hota our subject teacher
has also helped me a lot to complete this project. I feel so blessed
that I have learnt all this work with the help of our mam,we are
also thankful to our respected principal Ms. Jasaswini Pattnaik for
providing us various facilities to complete this project.
import mysql.connector
myConnnection
=""cursor=""
userName=""
password =""
roomrent =0
restaurentbill=0
gamingbill=0
fashionbill=0
totalAmount=0
cid=""
def
MYSQLconnectionCheck
():global myConnection
global
userName
global
password
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password ,
auth_plugin='mysql_native_password' )
if myConnection:
cursor=myConnection.cursor()
cursor.execute("COMM
IT")cursor.close()
return
myConnectionelse:
def
MYSQLconnection
()global userName
global password
global
myConnection
global cid
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password ,
database="HMS" , auth_plugin='mysql_native_password' )
if myConnection:
return
myConnectionelse:
myConnection.close()
def
userEntry():
global cid
if myConnection:
cursor=myConnection.cursor(
VARCHAR(20),C_NAMEVARCHAR(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 : ")
VALUES(%s,%s,%s,%s,%s,%s,%s)"values=
(cid,name,address,age,nationality,phoneno,email)
cursor.execute(sql,values)
cursor.execute("COMMIT")
Successfully !")cursor.close()
else:
def bookingRecord():
global cid
customer=searchCustom
er()if customer:
if myConnection:
cursor=myConnection.cursor()
cursor.execute(createTable)
values=
(cid,checkin,checkout)
cursor.execute(sql,values)
cursor.execute("COMMIT"
cursor.clo
se()else:
def roomRent():
global cid
customer=searchCustom
er()if customer:
global
roomrent if
myConnectio
n:
cursor=myConnection.cursor()
cursor.execute(createTable)
: "))
if roomchoice==1:
roomrent = noofdays * 10000
",roomrent)elif roomchoice==2:
",roomrent)
elif roomchoice==3:
",roomrent)elif roomchoice==4:
",roomrent)
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again
!!! ")return
values=
(cid,roomchoice,noofdays,roomno,roomrent,)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("Thank You , Your Room Has Been Booked For : ",noofdays , "Days" )
cursor.clo
se()else:
def Restaurent():
global cid
customer=searchCustom
er()if customer:
global
restaurentbillif
myConnection:
cursor=myConnection.cursor(
"""
cursor.execute(createTable)
"))if choice_dish==1:
elif choice_dish==2:
elif choice_dish==3:
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again
!!! ")return
values=
(cid,choice_dish,quantity,restaurentbill)
cursor.execute(sql,values)
cursor.execute("COMMIT")
***\n\n" )cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def Gaming():
global cid
customer=searchCustom
er()if customer:
global
gamingbillif
myConnectio
n:
cursor=myConnection.cursor()
cursor.execute(createTable)
print("""
7. Exit
""")
print("\n\n#################################################")
if game==1:
elif game==2:
print("YOU HAVE SELECTED TO PLAY : Bowling")
gamingbill = hour *
100elif game==3:
gamingbill = hour *
250elif game==4:
elif game==5:
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again
!!! ")return
values=
(cid,game,hour,gamingbill)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("\n\n#################################################")
cursor.clo
se()else:
def Fashion():
global cid
customer=searchCustom
er()if customer:
global
fashionbillif
myConnectio
n:
cursor=myConnection.cursor()
cursor.execute(createTa
ble)print("""
""")
")) if dress==1:
print("\nShirts")
fashionbill = quantity *
1500elif dress==2:
print("\nT-Shirts")
fashionbill = quantity *
300
elif dress==3:
print("\nPan
ts")
fashionbill = quantity *
2000elif dress==4:
print("\nJeans")
fashionbill = quantity *
4000elif dress==5:
print("\nTassel top")
fashionbill = quantity *
500
elif dress==6:
print("\nGo
wn")
fashionbill = quantity *
3000elif dress==7:
print("\nWestern dress")
fashionbill = quantity *
3000
elif dress==8:
print("\nSkir
ts")
fashionbill = quantity *
400elif dress==9:
print("\nTrousers")
fashionbill = quantity *
200
elif dress==10:
print("\nInnerWear")
fashionbill = quantity
* 30
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again
!!! ")return
values=
(cid,dress,quantity,fashionbill)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("\n\n#################################################")
print("\n\n#################################################")
cursor.clo
se()else:
def
totalAmount()
:global cid
customer=searchCustom
er()if customer:
global
grandTotal
global roomrent
global
restaurentbill
global
fashionbill
global
gamingbill
if myConnection:
cursor=myConnection.curs
or()
cursor.execute(createTable)
gamingbill
values= (cid,name,roomrent,restaurentbill ,
gamingbill,fashionbill,grandTotal)cursor.execute(sql,values)
cursor.execute("COMM
IT")cursor.close()
: Rs. ",gamingbill)
print(" ")print("\nTOTAL
cursor.clo
se()else:
def searchOldBill():
global cid
customer=searchCustom
er()if customer:
if myConnection:
cursor=myConnection.curs
or()
cursor.execute(sql,(cid,))
data=cursor.fetch
all()if data:
print(d
ata)else:
Again !")cursor.close()
else:
def
searchCustomer
():global cid
if myConnection:
cursor=myConnection.cursor()
cid=input("ENTER CUSTOMER ID
: ")
cursor.execute(sql,(ci
d,))
data=cursor.fetchall(
if data:
print(dat
a) return
True
else:
else:
""")
myConnection =
MYSQLconnectionCheck ()if
myConnection:
MYSQLconnecti
on ()while(True):
print("""
1--->Enter Customer
Details2--->Booking
Record
4--->Calculate Restaurant
Bill5--->Calculate Gaming
Bill
Bill7--->Display Customer
Details
10--->EXIT """)
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:
searchCustom
er()elif choice
==8:
totalAmou
nt()elif
choice ==9:
searchOld
Bill()elif
choice ==10:
br
eak
else
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
else:
USER AUTHENTICATION
CUSTOMER DETAILS
CUSTOMER BOOKING RECORDS
ROOM RENT
RESTAURANT BILL
GAMING BILL
FASHION STORE BILL
Details Of Customer
TOTAL BILL
OLD BILL
EXIT
MYSQL DATABASE AND TABLES USED IN THIS PROJECT
DATABASE
TABLE STRUCTURE 1 AND 2
TABLE STRUCTURE 7
Backend Data Generated Through Software
Backend Data Generated Through Software
Backend Data Generated Through Software
References
python.org
Code Academy
tutorialsPoint.com
PythonChallenge.com
Google’s Python Class
LearnPython.org