HOTEL MANAGEMENT FILE
HOTEL MANAGEMENT FILE
HOTEL MANAGEMENT FILE
INVESTIGATORY PROJECT
HOTEL MANAGEMENT
A Project Report
On
"COMPUTER SCIENCE- PYTHON"
Submitted to
CENTRAL BOARD OF SECONDARY EDUCATION,
NEW DELHI
Mayank Patel
Under the Guidance of Miss. Anjali Devi Thakur
CLASS- XII "A"
KENDRIYA VIDYALAYA RAIGARH
Near Circuit house Chandmaari Raigarh (CG) India - 496001 Phone - 91- 07762-
223238 E-mail rag mail.com
SESSION: 2020-2021
DECLARATION
This work is the result of inspiration, support, co-operation and facilities that
were extended to me at their best and most by persons at all the levels. We
are indebted to all of them.
We felt extremely exhilarated to have completed the project under the able
and inspiring guidance of respectable faculty of our school. We are highly
indebted to all of them for making available facilities for completing this
project.
Their benevolent nature and timely guidance infused courage in us to
complete the project successfully their impact was tremendous. We wouldn't
be exaggerating if we would say that they even revolutionized the way in
which we used to think and function, our profound thanks are due to them.
We pay our gratitude to all the respectable faculties of School who allowed us
to do this project. We also pay our profound sense of respect to gratitude for
providing necessary information and good guidance.
Finally, thanks to all who directly or indirectly have been supporting us and
standing by us all the time.
WITH REGARDS,
2 Title Page
3 Declaration
4 Certificate
5 Certificate by Examiners
6 Acknowledgement
7 Index
8 Abstract
9 Problem Definition and Analysis
10 Theoretical Background
11 System Implementation
12 Aims and Objective
13 SQL Queries
14 MySQL Tables
15 Python Code
16 Output
17 Bibliography
Abstract
The idea behind this project is to make the use of python-MySQL to decrease the problem
in hotel management while increasing the efficiency of the providing service to customers in
hotel during check in or while using some services provided by hotel .
On running the program several option appears including the options for checking in , using
food services , options for laundry services and the room types available.
Upon selecting option 1 prompt to fill customer's data appears which includes customer's
name , address , indate and outdate.
Options 3 leads to show the types of room available in Hotel for customers along with
information about size/dimensions as well as cost per night the avail the room.
Option 4 can be used to calculate the bill of customers as this option shows the type of
room and their price , after which days stayed and type of room can be entered to simply
calculate the bill of customer directly.
Option 5 gives a view of menu of food items served the hotel along with the standard price
for each item.
Option 6 is for calculating the restaurant bill which upon choosing shows the restaurant
menu followed by prompt to select the food item and amount of plates/items served.
option 7 gives a brief view of laundry services provided by the hotel for several types of
clothes along with the price for each type of cloth.
Upon selecting 8 the program the view of laundry menu followed by prompt to enter the
type of cloth and number of cloth for which laundry service was used.
Basic idea behind the project is getting simple program for maintaining the Hotel databases
for various details and bills for a particular customer.
Problem Definition and Analysis
Working with a system that require multiple inputs, multiple records linked to
each other in a complex way and keeping track of all data can be very hectic for
any person annually However, with programming and databases as backend,
we can shorten the time required and complexity of such a system. Using
Python-MySQL connectivity, we aspire to do exactly that.
PYTHON
Python is an interpreted, high-level, general-purpose programming language.
Created by Guido vanRossum and first released in 1991, Python's design
philosophy emphasizes code readability with its notable use of significant
whitespace. Its language constructs and object oriented approach aim tohelp
programmers write clear, logical code for small and large-scale projects.
Following are the reason to choose python for database programming
• Programming more efficient and faster compared to other languages.
• Portability of python programs.
• Support platform independent program development.
• Python supports SQL cursors.
• Python itself take care of open and close of connections.
• Python supports relational database systems.
• Porting of data from one dbms to other is easily possible as it supports
large range of APIs for various databases.
SQL
SOL is a domain-specific language used in programming and designed for
managing data held in a relational database management system (RDBMS), or
for stream processing in a relational data stream management system (RDSMS).
It is particularly useful in handling structured data, i.e. data incorporating
relations among entities and variables.
Advantages of SQL in managing databases:
Open Source & Free of Cost: It is Open Source and available at free of cost.
Portability: Small enough in size to install and run it on any types of Hardware
and OS like Linux, MS Windows or Mac etc.
Security: Its Databases are secured & protected with password.
Connectivity: Various APIS are developed to connect it with many programming
languages. Query Language It supports SQL (Structured Query Language) for
handling database.
PYTHON SQL INTERFACE
BACK END:
FRONT END:
While designing real life application, certain situations arise pertaining the
storage of some important and necessary information by the user. Usually the
data inputted but the user along with the generated output is displayed but not
stored.
System Implementation
• Python3.7
• MYSQL
• Microsoft Windows 10
Aims and Objectives
import mysql.connector
mydb = mysql.connector.connect(user='root',
password='root',host='localhost',database='hotel_stardust')
mycursor=mydb.cursor()
mycursor.execute("create table if not exists custdata(name char(30),\
addr varchar(50),\
indate date,\
outdate date)")
def registercust():
name=input("enter name:")
addr=input("enter address:")
indate=input("enter check in date:")
outdate=input("enter check out date:")
sql="insert into
custdata(custname,addr,indate,outdate)values('{}','{}','{}','{}')".format(name,addr,indate,outdate)
mycursor.execute(sql)
mydb.commit()
def viewcust():
print("Press 1 to view customer data")
ch=int(input("Enter your choice:"))
if ch==1:
sql="select * from custdata"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def roomtypeview():
print("Do yoy want to see room type available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from roomtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def roomrent():
print ("We have the following rooms for you:-")
print ("1. type A---->rs 1000 PN\-")
print ("2. type B---->rs 2000 PN\-")
if(userinput==1):
registercust()
elif(userinput==2):
viewcust()
elif(userinput==3):
roomtypeview()
elif(userinput==4):
roomrent()
elif(userinput==5):
restaurentmenuview()
elif(userinput==6):
orderitem()
elif(userinput==7):
laundrymenu()
elif(userinput==8):
laundrybill()
else:
print("enter correct choice")
Menuset()
def runagain():
runagn=input("\n want to run again y/n:")
while runagn=="y":
Menuset()
runagn=input("\n want to run again y/n:")
runagain()
OUTPUT