CS Final Project - Debasish Khatei

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

KENDRIYA VIDYALAYA

Malkangiri
COMPUTER SCIENCE
FINAL PROJECT
Topic : Hotel
Management System
NAME : DEBASISH KHATEI
CLASS : XII
ROLL NO : 34
GUIDED BY : MRS. ASHRITA PANDA
SCHOOL : KV MKG

submitted to principal`s
: mrs. ashrita panda signature
CERTIFICATE
This is certified that the project conducted have been
satisfactorily performed by DEBASISH KHATEI, a
student Studying in KENDRIYA VIDYALAYA
MALKANGIRI, ODISHA - Class XII ; Roll No : 34 During
The Academic Year 2022-23

This project is made on the topic :


HOTEL MANAGEMENT SYSTEM

Secondly i would like to thank my parents and friends


who helped me a lot in finishing this project within the
limited time.

I would also like to thank CBSE board for giving me this


opportunity to explore beyond the regular NCERT
textbook

teacher's principal`s
signature signature

ACKNOWLEDGEMENT
I Wish to express my deep gratitude and sincere
thanks to principal MR. IQRAR AHMAD, K.V.S Malkangiri
for his encouragement and for all the facilities that he
provided for this project work. I sincerely appreciate
the magnanimity by taking me into his fold for which i
shall remain indebted to him.

I Extend my healthy thanks to


MRS. ASHRITA PANDA

Who guided me to successful completion of this


project. I take this opportunity to express my deep
senses of gratitude for his valueable guidance,
constant encouragement constructive comments,
sympathetic attitude & immense, motivation, which
has sustained my efforts all stages of the project work
CONTENTS
1. Introduction
2. About The Project
3. Objective of the project
4. Code
5. Output screenshots
6. Conculsion
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 & retrieval, I used the interface of


python with SQL which enables to store data in the
form of tables in SQL.

ABOUT THE PROJECT :


This 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
INTRODUCTION :
Python is a high-level, interpreted, interactive and
object-oriented scripting language. Python is designed
to be highly readable. It uses English keywords
frequently where as other languages use punctuation,
and it has fewer syntactical constructions than other
languages.
Python is Interpreted :
Python is processed at runtime by the
interpreter. You can do not need to compile your
program before executing it! This is similiar to
PERL & PHP
Python is Interactive :
You can actually sit at a Python prompt and
interact with the interpreter directly to write your
programs
Python is Object-Oriented :
Python supports Object-Oriented style or
technique of programming that encapsulates
code within objects
Python is Beginner's Language :
Python is a great language for the beginner-level
programmers and supports the development of
a wide range of applications from simple text
processing to WWW Browser to games
HISTORY OF

Python was developed by Guido Van Rossum in the


late eighties and early nineties at the National
Research Institude for Mathematics & Computer
Science in the Netherlands.

Python is derived from many other languages,


including ABC, Modula-3, C, C++, Algol-68, SmallTalk,
& Unix shell and other scripting languages.

Python is copyrighted. Like Perl, Python source code is


now available under the GNU General Public License
(GPL).

Python is now maintained by a core development


team at the institute, although Guido Van Rossum still
holds a vital role in directing its process.

PYTHON FEATURES
Python`s Features include -
Easy To Learn -
Python has few keywords, simple structure, and a
clearly defined syntax. This allows the student to pick
up the language quickly.
Easy to read -
Python Code is more clearly defined and
visible to the eyes.

A broad standard library -


Python`s bulk of the library is very portable and cross-
platform compatible on UNIX, Windows & Macintosh
Interactive mode -
Python has support for an interactive mode which allows
interactive testing & debugging of snippets of code
Portable -
Python can run on a wode variety of hardware paltforms
and has the same interface on all platforms.
Extendable -
You can add low-level modules to the python
interpreter. These modules enable programmers to
add to or customize their tools to be more efficient.
Databases -
Python provides interfaces to all major commercial
databases
GUI Programming -
Python supports GUI applications that can be created
and ported to many systems calls, libraries and
windows systems, such as Windows MFC, Macintosh,
and the X Window system of UNIX
INTRODUCTION
ON MYSQL
1. Database :
A database is an organised collection of data.
Software used to manage databases is called Data
Base Management System (DBMS).
2. Relational Database :
A database in which the data is stored in the form of
relations (also called tables) is called a Relational
Database. In other words a Relational Database is a
collection of one or more tablets.
3. RDBMS :
A DBMS used to manage Relational Databases is called
RDBMS (Relational Data Base Management System).
Some popular RDBMS software available are : Oracle,
MySQL, Sybase, Ingress
4. Benefits of using a DBMS are :
a. Redunancy can be controlled
b. Inconsistence can be avoided
c. Data can be shared
d. Security restrictions can be applied
5. MySQL :
It is an Open Source RDBMS Software. It
is available free of cost.
6. Relation/Table :
A table refers to a 2D representation of data arranged
in columns (also called fields or attributes) and rows
(also called records or tuples)
7. Key :
A Column or a combination of columns which can be
used to identify one or more rows (tuples) in a table is
called a key of the table
8. Primary Key :
The group of one or more columns used to uniquely
identify each row of a relation is called its primary key.
9. Candidate Key :
A column or a group of columns which can be used as
the primary key of a relation is called a candidate key
because it is one of the candidates available to be the
primary key is called its Alternate Key.
10. Alternate Key :
A Candidate key of a table which is not made its primary
key is called its Alternate Key.
11. Degree :
Degree of a table is the number of columns in the table
12. Cardinality :
Cardinality of a table is the number of rows in a table
13. SQL (Structured Query Language) :
It is the language used to manipulate and manage
databases and tables within them using an RDBMS
14. DDL (Data Defination Language ) :
This is a category of SQL commands. All The commands
which are used to create, destroy, or restructure
databases and tables come under this category.
Examples Of DDL commands are - CREATE,DROP,ALTER
15. DML (Data Manipulation Language) :
This is a category of SQL commands. All the commands
which are used to create, destroy, or restructure
databases and tables come under this category. Examples
of DML commands are - INSERT, UPDATE, DELETE.
16. DCL (Data Control Language) :
This is a category of SQL commands. All the commands
which are used to control the access to databases and
tables fall under this category. Examples of DCL
commands are - GRANT, REVOKE.
SCALABLE :
Python provides a better structure and support for large
programs than shell scripting.

Apart from the above mentioned features, Python has a


big list of good features, few are listed below :
- It Supports functional and structured programming
methods as well as 00P
- It can be used as a scripting language or can be
compiled to byte-code for building large applications
- It provides very high-level dynamic data types and
supports dynamic type checking
- It supports automatic garbage collection.
- It can be easily integrated with C, C++, COM, ActiveX,
CORBA, & Java
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
(101, 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)
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 :
WELCOME TO
MOHAN INTERNATIONAL

ENTER CUSTOMER DATA------------[1]


VIEW ROOMTYPE---------------------[2]
BOOK A ROOM------------------------[3]
VIEW RESTAURANT MENU----------[4]
ORDER FOOD--------------------------[5]
LAUNDRY------------------------------[6]
COMPLETE BILL-----------------------[7]
EXIT-------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION : 1
ENTER YOUR NAME:BIBHU
ENTER YOUR ADDRESS: BAM
ENTER YOUR CHECK IN DATE:14-10-2019
ENTER YOUR CHECK OUT DATE:28-10-2019
THANK YOU
DO AGAIN? (Y/N):Y
ENTER CUSTOMER DATA------------[1]
VIEW ROOMTYPE---------------------[2]
BOOK A ROOM------------------------[3]
VIEW RESTAURANT MENU----------[4]
ORDER FOOD--------------------------[5]
LAUNDRY------------------------------[6]
COMPLETE BILL-----------------------[7]
EXIT-------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION : 2
(1, 'TYPE A', 1000)
(2, 'TYPE B', 2000)
(3, 'TYPE C', 3000)
(4, 'TYPE D', 4000)
THANK YOU
DO AGAIN? (Y/N): Y
ENTER CUSTOMER DATA-----------[1]
VIEW ROOMTYPE--------------------[2]
BOOK A ROOM-----------------------[3]
VIEW RESTAURANT MENU---------[4]
ORDER FOOD-------------------------[5]
LAUNDRY-----------------------------[6]
COMPLETE BILL----------------------[7]
EXIT------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION :3
WE FOLLOWING ROOMS FOR YOU:-
TYPE A---->Rs. 1000 PN\----[1]
TYPE B---->Rs. 2000 PN\----[2]
TYPE C---->Rs. 3000 PN\----[3]
TYPE D---->Rs. 4000 PN\----[4]
ENTER YOUR CHOICE PLEASE->4
For HOW MANY NIGHTS DO YOU WANT TO STAY:6
YOU HAVE OPTED FOR ROOM TYPE D
YOU HAVE OPTED FOR ROOM TYPE D
PAYMENT
YOU WANT TO PAY WITH:
1. DEBIT CARD
2. CREDIT CARD
ENTER CARD TYPE (1/2):2
ENTER YOUR CARD NO.:242144
ENTER YOUR PASSWORD:2312
CONNECTING...
PAYMENT SUCCESSFUL

------------------------------------------------------------------------------------------------
_BILL_
YOUR ACCOUNT IS DEBITED WITH Rs. 24000 ON 2019-10-14 AT 11:02:19 \
THANK YOU
DO AGAIN? (Y/N): Y
ENTER CUSTOMER DATA-------------[1]
VIEW ROOMTYPE----------------------[2]
BOOK A ROOM-------------------------[3]
VIEW RESTAURANT MENU-----------[4]
ORDER FOOD---------------------------[5]
LAUNDRY-------------------------------[6]
COMPLETE BILL------------------------[7]
EXIT--------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION :4
(1, 'TEA', 10)
(2, 'COFFEE', 10)
(3, 'COLD DRINK', 20)
(4. 'SAMOSA, 10)
(5, 'SANDWICH', 50)
(6, 'DOSA', 60)
(7, 'VADA', 10)
(8, 'MILK', 20)
(9, 'NOODLES, 50)
(10, 'PASTA', 50)
THANK YOU
DO AGAIN? (Y/N): Y
ENTER CUSTOMER DATA------------[1]
VIEW ROOMTYPE---------------------[2]
BOOK A ROOM------------------------[3]
VIEW RESTAURANT MENU----------[4]
ORDER FOOD--------------------------[5]
LAUNDRY------------------------------[6]
COMPLETE BILL-----------------------[7]
EXIT-------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION :5
(1, 'TEA', 10)
(2, 'COFFEE', 10)
(3, 'COLD DRINK', 20)
(4, 'SAMOSA', 10)
(5, 'SANDWICH', 50)
(6, 'DOSA', 60)
(6, 'DOSA', 60)
(7, 'VADA', 10)
(8, 'MILK', 20)
(9, 'NOODLES', 50)
(10, 'PASTA', 50)
ENTER YOUR CHOICE : 5
YOU HAVE ORDERED FOR SANDWICH
ENTER QUANTITY:2
YOUR AMOUNT FOR SANDWICH IS Rs. 100

THANK YOU
DO AGAIN? (Y/N):Y
ENTER CUSTOMER DATA-------------[1]
VIEW ROOMTYPE----------------------[2]
BOOK A ROOM-------------------------[3]
VIEW RESTAURANT MENU-----------[4]
ORDER FOOD---------------------------[5]
LAUNDRY-------------------------------[6]
COMPLETE BILL------------------------[7]
EXIT--------------------------------------[8]
PLEASE SELECT AN ABOVE OPTION : 6
(1, 'SHIRT', 10)
(2, 'PANT', 10)
(3. 'SUIT', 10)
(4, 'SAARI', 10)
ENTER YOUR NUMBER OF CLOTHES :4
YOUR LAUNDRY BILL: Rs. 40

YOUR LAUNDRY BILL Rs. 40

THANK YOU
DO AGAIN? (Y/N): Y
ENTER CUSTOMER DATA-------------[1]
VIEW ROOMTYPE----------------------[2]
BOOK A ROOM-------------------------[3]
VIEW RESTAURANT MENU-----------[4]
ORDER FOOD---------------------------[5]
LAUNDRY-------------------------------[6]
COMPLETE BILL------------------------[7]
EXIT------------------------------------- [8]
PLEASE SELECT AN ABOVE OPTION :7
ENTER YOUR NAME :BIBHU
CUSTOMER NAME: BIBHU

LAUNDRY BILL: 40
RESTAURANT BILL: 100
TOTAL AMOUNT: 140
THANK YOU
DO AGAIN? (Y/N):N
THANKS
WE HOPE YOU ENJOYED OUR SERVICES
VISIT AGAIN

MOHAN INTERNATIONAL
CONCLUSION
We can hereby conclude that :
The system effecytively 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 & scalable
The system design has been done keeping user-
friendliness and efficiency in mind.

SCOPE OF THE
PROJECT :
Scope of the project is to replace the manual work of
hotel management with the new computerized system.
User does not need much training to use this software,
as this software is very user friendly and easy to use. It
replaces all the paper work also. In this software, we
can store thousands of records. It replaces all the
calculation works also as it calculates and print the
bills. Some advantages are:
If any invalid entry done by the users which is
nature of human being, it gives the error message
to the users to enter valid input.
BIBILOGRAPHY
https://www.python.org
https://www.mysql.com
https://pythontrends.wordpress.com
Computer Science with Python by Sumita Arora
Python Essential Reference by David M. Beazley
Learning Python by Mark Lutz
www.google.com and www.scribd.com
thank
YOU!

You might also like