Vous êtes sur la page 1sur 20

Computer SCIENCE PYTHON

project
On
hotel management system

PROJECT PREPARED BY: MANMAY BISHAL


BOARD ROLL NO: ____________
CLASS: XII SCIENCE
Session: 2019-20

UNDER THE GUIDANCE OF


Mr.manasH ranjan sahoo
PGT(Computer Science)

KENDRIYA VIDYALAYA No.4


NEELADRI VIHAR
BHUBANESWAR-751021
Certificate
This is certify that Manmay Bishal of class XII Science, has
successfully completed their project on Computer Science practical
for the AISSCE (All India Senior School Certificate Examination) as
prescribed by CBSE in the year 2019-20

Date:

Signature of Subject Signature of Principal


Teacher

____________________ ___________________

Signature of External Examiner

_______________________
ACKNOWLEDGEMENT

We thank our computer teacher Mr.Manash Ranjan Sahoo for guidance


and support. I also thank our Principal Mrs. Aneeta Dash. I would like
to thank all of our friends and teachers for encouraging us during the
course of this project. Finally I would like to thank CBSE for giving us
this opportunity to undertake this project.

Name: Manmay Bishal


Board Roll:
Class: XII Science
Session: 2019-20
CONTENTS

1. INTRODUCTION

2. ABOUT THE PROJECT

3. OBJECTIVE OF THE PROJECT

4. CODE

5. OUTPUT SCREENSHOTS

6. CONCLUSION

7. SCOPE OF THE PROJECT

8. BIBLIOGRAPHY
INTRODUCTION

This project on “HOTEL MANAGEMENT SYSTEM” is the


automation of the management process of a hotel. The system is able
to provide information such as hotel room information, hotel services,
bills etc. The system also enables the passenger to book their rooms,
pay the price on the spot.

For data storage and retrieval, I used the interface of Python with SQL
which enables to store data in the form of tables in SQL.
ABOUT THE PROJECT

The project named “HOTEL MANAGEMENT SYSTEM” is written


in Python. Python is an Object-Oriented Programming language and is
intended to be a more high level language and programmer friendly
than the C, C++, etc. languages.

Every possible care has been taken to make the software and the report
clear, simple and error free which makes it special.
OBJECTIVE OF THE PROJECT

 Provide some amount of automation in hotel management.

 To help hotels make their business efficient.

 To make booking of rooms easier and faster.

 To reduce cost.
SOURCE CODE
import mysql.connector
global z

mydb = mysql.connector.connect(user='root',
password='root',host='localhost')
mycursor=mydb.cursor()

mycursor.execute("create database hotel")


mydb.commit()
mycursor.execute("use hotel")
mydb.commit()
mycursor.execute("create table custdata(custname char(10),addr
char(10),indate char(10),outdate char(10))")
mydb.commit()
mycursor.execute("create table roomtype(sno int(5),roomtype
char(10),rent int(10))")
mydb.commit()
mycursor.execute("insert into roomtype values(%s,'%s',%s)"%(1,'TYPE
A',1000))
mydb.commit()
mycursor.execute("insert into roomtype values(%s,'%s',%s)"%(2,'TYPE
B',2000))
mydb.commit()
mycursor.execute("insert into roomtype values(%s,'%s',%s)"%(3,'TYPE
C',3000))
mydb.commit()
mycursor.execute("insert into roomtype values(%s,'%s',%s)"%(4,'TYPE
D',4000))
mydb.commit()
mycursor.execute("create table restaurant(sno int(10),itemname
char(10),rate int(4))")
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(1,"TEA",10))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(2,"COFFEE",10))
mydb.commit()
mycursor.execute("insert into restaurant values(%s,'%s',%s)"%(3,"COLD
DRINK",20))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(4,"SAMOSA",10))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(5,"SANDWICH",50))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(6,"DOSA",60))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(7,"VADA",10))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(8,"MILK",20))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(9,"NOODLES",50))
mydb.commit()
mycursor.execute("insert into restaurant
values(%s,'%s',%s)"%(10,"PASTA",50))
mydb.commit()
mycursor.execute("create table laundry(sno int(3),itemname
char(10),rate int(3))")
mydb.commit()
mycursor.execute("insert into laundry
values(%s,'%s',%s)"%(1,"SHIRT",10))
mydb.commit()
mycursor.execute("insert into laundry
values(%s,'%s',%s)"%(2,"PANT",10))
mydb.commit()
mycursor.execute("insert into laundry
values(%s,'%s',%s)"%(3,"SUIT",10))
mydb.commit()
mycursor.execute("insert into laundry
values(%s,'%s',%s)"%(4,"SAARI",10))
mydb.commit()

print("________________________________________________________________
__________________________________________")
print(" WELCOME TO")
print(" MOHAN INTERNATIONAL")
print("________________________________________________________________
__________________________________________")
while True:
def registercust():
L=[]
name=input("ENTER YOUR NAME:")
L.append(name)
addr=input("ENTER YOUR ADDRESS:")
L.append(addr)
indate=input("ENTER YOUR CHECK IN DATE:")
L.append(indate)
outdate=input("ENTER YOUR CHECK OUT DATE:")
L.append(outdate)
cust=(L)
sql="insert into
custdata(custname,addr,indate,outdate)values(%s,%s,%s,%s)"
mycursor.execute(sql,cust)
mydb.commit()
print("THANK YOU")
def roomtypeview():
sql="select * from roomtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
print("THANK YOU")
def roomrent():
print ("WE HAVE FOLLOWING ROOMS FOR YOU:-")
print ("TYPE A---->Rs. 1000 PN\-----[1]")
print ("TYPE B---->Rs. 2000 PN\-----[2]")
print ("TYPE C---->Rs. 3000 PN\-----[3]")
print ("TYPE D---->Rs. 4000 PN\-----[4]")
x=int(input("ENTER YOUR CHOICE PLEASE->"))
n=int(input("For HOW MANY NIGHTS DO YOU WANT TO STAY:"))
if(x==1):
print ("YOU HAVE OPTED FOR ROOM TYPE A")
s=1000*n
elif (x==2):
print ("YOU HAVE OPTED FOR ROOM TYPE B")
s=2000*n
elif (x==3):
print ("YOU HAVE OPTED FOR ROOM TYPE C")
s=3000*n
elif (x==4):
print ("YOU HAVE OPTED FOR ROOM TYPE D")
s=4000*n
else:
print ("PLEASE CHOOSE YOUR ROOM")
print ("YOUR ROOM RENT IS =",s,"\n")
import getpass
print(" PAYMENT")
print("YOU WANT TO PAY WITH:")
print("1. DEBIT CARD")
print("2. CREDIT CARD")
ctype=input("ENTER CARD TYPE (1/2):")
card=input("ENTER YOUR CARD NO.:")
passwd=input("ENTER YOUR PASSWORD:")
print("CONNECTING...")
print("PAYMENT SUCCESSFUL")

print("________________________________________________________________
__________________")
mycursor.execute("select now()")
N=mycursor.fetchall()
N=N[0][0]
N=str(N).split()
print(" _BILL_")
print("YOUR ACCOUNT IS DEBITED WITH Rs.",s,"ON",N[0],"AT",N[1])
print("THANK YOU")
def restaurantmenuview():
sql="select * from restaurant"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
print("THANK YOU")
def orderitem():
global s
sql="select * from restaurant"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
d=int(input("ENTER YOUR CHOICE:"))
if(d==1):
print("YOU HAVE ORDERED FOR TEA")
a=int(input("ENTER QUANTITY:"))
s=10*a
print("YOUR AMOUNT FOR TEA IS : Rs.",s,"\n")
elif (d==2):
print("YOU HAVE ORDERED FOR COFFEE")
a=int(input("ENTER QUANTITY:"))
s=10*a
print("your amount for coffee is : Rs.",s,"\n")
elif(d==3):
print("YOU HAVE ORDERED FOR COLD DRINK")
a=int(input("ENTER QUANTITY:"))
s=20*a
print("YOUR AMOUNT FOR COLD DRINK IS : Rs.",s,"\n")
elif(d==4):
print("YOU HAVE ORDERED FOR SAMOSA")
a=int(input("ENTER QUANTITY:"))
s=10*a
print("YOUR AMOUNT FOR SAMOSA IS : Rs.",s,"\n")
elif(d==5):
print("YOU HAVE ORDERED FOR SANDWICH")
a=int(input("ENTER QUANTITY:"))
s=50*a
print("YOUR AMOUNT FOR SANDWICH IS : Rs.",s,"\n")
elif(d==6):
print("YOU HAVE ORDERED FOR DOSA")
a=int(input("ENTER QUANTITY:"))
s=30*a
print("YOUR AMOUNT FOR DOSA IS : Rs.",s,"\n")
elif(d==7):
print("YOU HAVE ORDERED FOR VADA")
a=int(input("ENTER QUANTITY:"))
s=10*a
print("YOUR AMOUNT FOR VADA IS : Rs.",s,"\n")
elif(d==8):
print("YOU HAVE ORDERED FOR MILK")
a=int(input("ENTER QUANTITY:"))
s=20*a
print("YOUR AMOUNT FOR MILK IS : Rs.",s,"\n")
elif(d==9):
print("YOU HAVE ORDERED FOR NOODLES")
a=int(input("ENTER QUANTITY:"))
s=50*a
print("YOUR AMOUNT FOR NOODLES IS : Rs.",s,"\n")
elif(d==10):
print("YOU HAVE ORDERED FOR PASTA")
a=int(input("ENTER QUANTITY:"))
s=50*a
print("YOUR AMOUNT FOR PASTA IS : Rs.",s,"\n")
else:
print("PLEASE ENTER YOUR CHOICE FROM THE MENU")
print("THANK YOU")
def laundrybill():
global z
sql="select * from laundry"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
y=int(input("ENTER YOUR NUMBER OF CLOTHES :"))
z=y*10
print("YOUR LAUNDRY BILL : Rs.",z,"\n")
print("THANK YOU")
return z
def viewbill():
a=input("ENTER YOUR NAME :")
print("CUSTOMER NAME :",a,"\n")
print("LAUNDRY BILL :",z)
print("RESTAURANT BILL :",s)
print("TOTAL AMOUNT :",z+s)
print("THANK YOU")
def Menuset():
print("ENTER CUSTOMER DATA----------[1]")
print("VIEW ROOMTYPE----------------[2]")
print("BOOK A ROOM------------------[3]")
print("VIEW RESTAURANT MENU---------[4]")
print("ORDER FOOD-------------------[5]")
print("LAUNDRY----------------------[6]")
print("COMPLETE BILL----------------[7]")
print("EXIT-------------------------[8]")
Menuset()
try:
userinput=int(input("PLEASE SELECT AN ABOVE OPTION :"))
except ValueError:
continue
if(userinput==1):
registercust()
elif(userinput==2):
roomtypeview()
elif(userinput==3):
roomrent()
elif(userinput==4):
restaurantmenuview()
elif(userinput==5):
orderitem()
elif(userinput==6):
laundrybill()
elif(userinput==7):
viewbill()
elif(userinput==8):
break
else:
print("INVALID INPUT !!!")
print("PLEASE TRY AGAIN")
continue
ask=input("DO AGAIN? (Y/N):").upper()
if ask=='N':
break
print("THANKS")
print("WE HOPE YOU ENJOYED OUR SERVICES")
print("VISIT AGAIN")
print("________________________________________________________________
__________________________________________")
print(" MOHAN INTERNATIONAL")
print("________________________________________________________________
__________________________________________")
mydb.close()
OUTPUT SCREENSHOTS
CONCLUSION

We can hereby conclude that:

 The system effectively automated the functions involved in the


processes being handled manually before.

 The cost and benefit analysis shows that the system was quite
successful in saving costs and generate benefits.

 The system is secure and scalable.

 The system design has been done keeping user-friendliness and


efficiency in mind.
FUTURE SCOPE

 This hotel management project is not yet complete and in the


future more features will be included in this project. And those
features are : -

 offers and discounts


 bill calculations
 dining in the restaurant of the hotel
 near by tourist places
 pick and drop facilities for the guests
BIBLIOGRAPHY

The source of this project has been collected from our text Sumita
Arora. The code has been self modified.

For the description


1.book name –computer science with python
Dhanpat pai publications
By Sumitra Arora
2. Wikipedia
3.www.python.org
MODULES (IMPORTED) USED

 import mysql.connector
 import getpass
REQUIREMENTS

 HARDWARE REQUIRED

 Printer, to print the required documents of the project


 Processor : Intel i5 Processor
 Ram : 2 GB
 Hard disk: 500 GB.

 SOFTWARE REQUIRED

 Operating system : Windows 8/10


 Python 3.7.0 for execution of program and
 Ms Word, for presentation of output.

Vous aimerez peut-être aussi