HOTEL MANAGEMENT FILE

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

COMPUTER SCIENCE

INVESTIGATORY PROJECT

HOTEL MANAGEMENT
A Project Report
On
"COMPUTER SCIENCE- PYTHON"
Submitted to
CENTRAL BOARD OF SECONDARY EDUCATION,
NEW DELHI

In partial fulfillment of requirement for the Computer Science Practical exam


From

KENDRIYA VIDYALAYA RAIGARH “CHHATTISGARH"


by

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

I undersigned solemnly declare that the report of the project work


entitled "COMPUTER SCIENCE PYTHON" is based my own work
carried out during my Study under the supervision of Miss Anjali Devi
Thakur

I assert that the statement made and conclusions drawn are an


outcome of the project Work. further declare that to the best of my
knowledge and belief that the report does not contain any part of
any work which has been submitted for the award of any other
degree/diploma/certificate in the KVS or any board.

MAYANK PATEL ………………………


CERTIFICATE
This is to certify that the report of the project submitted by is an outcome of
the Project work entitled "COMPUTER SCIENCE" carried out by Mayank Patel
bearing Roll No -______________ carried out under my guidance and
supervision for the fulfillment of the requirements of Class XII Practical Exam
of Central Board of Secondary Education, New Delhi, India.
To the best of my knowledge the report
i. Embodies the work of the candidate herself,
ii. Has duly been completed,
iii. Fulfills the requirement of the Ordinance relating to the Exam and is
up to the desire standard for the purpose of which is submitted .

(Signature of the Guide)


Miss Anjali Devi Thakur
Post Graduate Teacher (Computer Science)
Kendriya Vidyalaya, Raigarh (C.G.)

The Project work as mentioned above is here by being recommended and


forwarded for examination and evaluation.

(Signature of the Principal with seal)


Mr. Harilal Padhan
Kendriya Vidyalaya, Raigarh (C.G.)
This is to certify that the project work entitled COMPUTER SCIENCE-
PYTHON
Name of the student : MAYANK PATEL
Roll No. : __________________

Has been examined by the undersigned as a part of the examination


for the End of Session Practical Exam in COMPUTER SCIENCE of
Central Board of Secondary Education.

Internal Examiner External Examiner


Miss Anjali Devi Thakur Mr. _______________
Date: Date:
ACKNOWLEDGEMENT

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,

(Signature of the Student)


Name: Mayank Patel
Roll No.:
INDEX

S.No. Title Page


No.
1 Cover

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 .

The working of program have been illustrated below:

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.

Upon selecting option 2 prompt to view customer’s detail appears .

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.

➢ To provide a completely automated system; it gives prompt to users to


enter data and provides services according to it.
➢ The coded system will maintain all the records and should generate the
required reports and information when required.
➢ To provide efficient and secured information storage, flow and retrieval
system, ensuring the integrity and validity of records.
➢ To provide user-friendly interface to interact with a centralized database
based on client E server architecture.
➢ To identify the critical operations procedure and possibilities of
simplification using modern IT tools and practices.
Theoretical Background

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:

While working with an application, it is required to save data permanently on


some secondary storage device, which is usually the hard disk, so that stored
data could be used for future reference, modification, deletion and retrieval.An
application usually stores a lot of data in form of a database which is not
directly accessible from the user. This database is used by the application to
give suitable response to the user. This database is called Back-end database.

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

The hardware used:

While developing the system, the used hardware is:


• Laptop
While developing the system, the used software is

• Python3.7
• MYSQL
• Microsoft Windows 10
Aims and Objectives

To use python-MySQL interface to connect logic with a database for


hotel management.
Objective:
• To provide solution for hotel to manage most of the work
computerized.
• To provide quality of service to customers according to those
who can satisfy them.
• Keeping the best hotel facilities.
• Help admin to handle customers information, room allocation,
payment details, billing, tourism.
• To avoid time consuming, we provide easy and quick access
over the data.
SQL QUERIES

create database if not exist hotel_stardust;


create table custdata(custname char(50),addr varchar(50),indate date,outdate
date);
create table laundry(S_no int(2),Cloth_type char(10),Cost_per_cloth int(4));
create table restaurent(S_no int(3),Menu_item char(30), Price_per_rs int(3));
create table roomtype(Type char(30),Type_name char(30),Size
varchar(10),Price_pernight int(7));

insert into laundry values(1,"cotton",400);


insert into laundry values(2,"Nylon",300);
insert into laundry values(3,"Rayon",300);
insert into laundry values(4,"Polyester",300);
insert into laundry values(5,"Linen",500);
insert into laundry values(6,"Cashmere",40;0)
insert into laundry values(7,"Silk",400);
insert into laundry values(8,"Wool",400);

insert into restaurent values(1,"Tea",10);


insert into restaurent values(2,"Coffee",10);
insert into restaurent values(3,"Coldrink",20);
insert into restaurent values(4,"Samosa",10);
insert into restaurent values(5,"Sandwich",40);
insert into restaurent values(6,"Dhokla",30);
insert into restaurent values(7,"Kachori",10);
insert into restaurent values(8,"Milk",20);
insert into restaurent values(9,"Noodles",50);
insert into restaurent values(10,"Pasta",50);

insert into roomtype values("Type_A","single","35*35",1000);


insert into roomtype values("Type_B","Double","45*45",2000);
insert into roomtype values("Type_c","King","50*50",3000);
insert into roomtype values("Type_D","Suite","70*70",4000);
MySQL TABLES
PYTHON CODE

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\-")

print ("3. type C---->rs 3000 PN\-")


print ("4. type D---->rs 4000 PN\-")
x=int(input("Enter Your Choice Please->"))
n=int(input("For How Many Nights Did You Stay:"))
if(x==1):
print ("you have opted room type A")
s=1000*n
elif (x==2):
print ("you have opted room type B")
s=2000*n
elif (x==3):
print ("you have opted room type C")
s=3000*n
elif (x==4):
print ("you have opted room type D")
s=4000*n
else:
print ("please choose a room")
print ("your room rent is =",s,"\n")
def restaurentmenuview():
print("Do yoy want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from restaurent"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def orderitem():
print("Do you want to see menu available : Enter 1 for yes")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from restaurent"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
print("do you want to purchase from above list:enter s.no as your choice")
d=int(input("enter your choice"))
if(d==1):
print("you have ordered tea")
a=int(input("enter quantity:"))
s=10*a
print("your amount for tea is :",s,"\n")
elif (d==2):
print("you have ordered coffee")
a=int(input("enter quantity:"))
s=10*a
print("your amount for coffee is :",s,"\n")
elif(d==3):
print("you have ordered colddrink")
a=int(input("enter quantity:"))
s=20*a
print("your amount for colddrink is :",s,"\n")
elif(d==4):
print("you have ordered samosa")
a=int(input("enter quantity:"))
s=10*a
print("your amount fopr samosa is :",s,"\n")
elif(d==5):
print("you have ordered sandwich")
a=int(input("enter quantity:"))
s=40*a
print("your amount for sandwich is :",s,"\n")
elif(d==6):
print("you have ordered dhokla")
a=int(input("enter quantity:"))
s=30*a
print("your amount for dhokla is :",s,"\n")
elif(d==7):
print("you have ordered kachori")
a=int(input("enter quantity;"))
s=10*a
print("your amount for kachori is :",s,"\n")
elif(d==8):
print("you have ordered milk")
a=int(input("enter quantity:"))
s=20*a
print("your amount for milk is :",s,"\n")
elif(d==9):
print("you have ordered noodles")
a=int(input("enter quantity:"))
s=50*a
print("your amount for noodles is :",s,"\n")
elif(d==10):
print("you have ordered pasta")
a=int(input("enter quantity:"))
s=50*a
print("your amount for pasta is :",s,"\n")
else:
print("please enter your choice from the menu")
def laundrymenu():
print("Please type 1 again to view laundry menu")
x=int(input("Enter your choice:"))
if x==1:
sql="select * from laundry"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def laundrybill():
print("Do yoy want to see rate for laundary : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from laundry"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
print("Enter the s.no of cloth you want to get laundry service")
a=int(input("Enter your choice:"))
if a==1:
print("You have chosen cotton cloth")
b=int(input("enter number of cloth:"))
s=400*b
print("please pay",s,"rupees")
elif a==2:
print("You have chosen nylon cloth")
b=int(input("enter number of clothes:"))
s=300*b
print("please pay",s,"rupees")
elif a==3:
print("You have chosen rayon cloth")
b=int(input("enter number of clothes:"))
s=300*b
print("please pay",s,"rupees")
elif a==4:
print("You have chosen polyester cloth")
b=int(input("enter number of clothes:"))
s=300*b
print("please pay",s,"rupees")
elif a==5:
print("You have chosen linen cloth")
b=int(input("enter number of clothes:"))
s=500*b
print("please pay",s,"rupees")
elif a==6:
print("You have chosen cashmere cloth")
b=int(input("enter number of clothes:"))
s=400*b
print("please pay",s,"rupees")
elif a==7:
print("You have chosen silk cloth")
b=int(input("enter number of clothes:"))
s=400*b
print("please pay",s,"rupees")
elif a==8:
print("You have chosen woolen cloth")
b=int(input("enter number of clothes:"))
s=400*b
print("please pay",s,"rupees")
else:
print("Please choose option from menu")
def Menuset():
print("enter 1: To enter customer data")
print("enter 2: To view customer data")
print("enter 3: To view roomtype")
print("enter 4: for calculating room bill")
print("enter 5: for viewing restaurent menu")
print("enter 6: for restaurent bill")
print("enter 7: To view laundry menu")
print("enter 8: for laundry bill")
try:
userinput=int(input("please select an above option:"))
except ValueError:
exit("\n hi thats not a number")

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

You might also like