0% found this document useful (0 votes)
11 views

Compproagrim

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Compproagrim

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

AISSCE PRACTICAL EXAMINATION

2023-2024

HEM SHEELA MODEL SCHOOL


DURGAPUR
HOTEL MANAGEMENT SYSTEM

NAME: AGRIM MAHAJAN


CLASS: XII
SECTION: G
BOARD ROLL NO.:

1|Page
TEACHER’S CERTIFCATE

This is to certify that Agrim Mahajan of Class XII, Section- G, Roll No.
03 of Hem Sheela Model School, Durgapur has completed the assigned
project file on Computer Science for AISSCE Practical Examination
2023-2024. He has prepared and submitted the project file by following
guidelines and instruction given by the teachers and within speculated
time of submission allotted for the partial fulfillment of AISSCE 2022-
23.

---------------------------------- -----------------------------------
Internal Teacher’s Signature External Teacher’s Signature

2|Page
ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to my Computer


Science teacher, Manoranjan Modi Sir, who gave me the golden
opportunity to do this project, which also helped me in doing a lot of
research and I come to know about so many new things and could
increase my programming skill.

I am really thankful to him.

Secondly I would also like to thank my parents who helped me a lot in


finishing this project within the limited time frame.

______________________
Student’s Signature

3|Page
INDEX
SL NO. TOPIC PAGE NO. REMARKS

1. Teacher’s Certificate 02

2. Acknowledgement 03
3. Index 04
4. Project Requirements 05

5. Project Description 05
6. Data Dictionary 06-08
7. Code 09-14
8. Output 15-17

9. Bibliography 18

4|Page
PROJECT REQUIREMENTS

 SOFTWARE:-
 PYTHON 3.7
 MYSQL9

 HARDWARE:-
 PC WITH WINDOWS INSTALLED

------------------------------------------------------------------------------------------------------------------------------------------

PROJECT DESCRIPTION

This is a hotel management system. Using this system, we can get the details of the
available rooms and types of rooms available. Also we can book the room using
this. Images of rooms can also be viewed using this. We can also cancel our
booked rooms using this. The frontend software used in this project is Python 3.7
and the backend software used is MySQL 8.

DATA DICTIONARY
5|Page
SHOWMENU() Block: This block is used to show the various options
to the users.
SL.NO. Object/ Description Use
Labels Used
1. Ch int Temporary variable to store
the choices of the user.

CREATEROOM() block: This block is used to create rooms in the


hotel. This is the input block.
SL.No. Object/Labels Description Use
used
1. rno int To store the room
number.
2. rtype string To store the Type of the
room.
3. guestno int To store the number of
guests that can
accommodate.
4. loc str To store the location of
the room.
5. rent int To store the per night
price of the room.
6. status str To store the status of the
room.
7. data tuple Temporary variable to
input the records into the
database.

SHOWROOMS() Block: This block shows the status all all rooms in
the hotel.

6|Page
SHOWVACANTROOMS() Block: This block is used to show the
details and status of all the available rooms in the hotel.
SHOWOCCUPIEDROOMS() Block: This block is used to show the
status of all occupied rooms in the hotel.
BOOKROOM() Block: This block is used to book rooms for the user.
This is basically the modification block.
Sl No. Objects/Labels Description Use
Used
1. Cname str To store the name of the
customer.
2. idtype str To store the identity type
of the customer.
3. idno str To store the ID number
of the customer.
4. address str To store the address of
the customer.
5. phone int To store the phone
number of the customer
6. gender str To store the gender of the
customer.
7. dcheckin str To store the date of check
in.
8. room_no int To store the room
number.
9. data tuple To input the records into
the database.

CHECKOUT() Block: This block deletes the status and records when a
customer checkout from the hotel. This is the deletion block.

7|Page
IN BUILT MODULE USED:
mysql.connector Module: This enables the python program to access
MySQL databases. The database used in the program is HOTEL.

CODE
import mysql.connector as mycon

8|Page
con=mycon.connect(host=”localhost”,user=”root”,password
=”123456”,database=”HOTEL”)

def SHOWMENU():

print("=============================================
====================")

print("--------------------WELCOME TO HOTEL
NIRVANA---------------------")
print("=============================================
====================")

while True:

print("ENTER 1 TO- Create a NEW ROOM")

print("ENTER 2 TO- Show All Rooms")

print("ENTER 3 TO- Show All Vacant Rooms")

print("ENTER 4 TO- Show All Occupied Rooms")

print("ENTER 5 TO- Book a Room for a Customer")

print("ENETR 6 TO- Check Out a Customer")

print("ENTER 7 TO- Exit")

ch=int(input("Enter your choice : "))

if ch == 1:

CREATEROOM()

elif ch== 2:

SHOWROOMS()

elif ch== 3:

SHOWVACANTROOMS()

elif ch== 4:

9|Page
SHOWOCCUPIEDROOMS()

elif ch== 5:

BOOKROOM()

elif ch== 6:

CHECKOUT()

elif ch== 7:

break

def CREATEROOM():

print("=============================================
====================")

print(" --------------------ENTER ROOM


DETAILS------------------------- ")
print("=============================================
=====================")

rno=int(input("Enter Room Number : "))

print("Enter room type: ")

print("(Simple/Double/Twin/Cabana/Studio/Lanai/
Standard suite/Executive suite)")

rtype=input("Enter your choice")

guestno=int(input("Enter maximum number of guests


that can be accomodated: "))

loc=input("Enter Location of the room : ")

rent=int(input("Enter Per Night Charges : "))

status= "Vacant"

q=”insert into rooms values(%s,%s,%s,%s,%s,%s)”

10 | P a g e
data=(rno,rtype,guestno,loc,rent,status)

cur1=con.cursor()

cur1.execute(q,data)

con.commit()

print("=============================================
====================")

print("------------------ROOM CREATION IS
SUCCESSFULL-------------------")

print("=============================================
====================")

def SHOWROOMS():

q=”select * from rooms”

cur1=con.cursor()

cur1.execute(q)

res=cur1.fetchall()

for row in res:

print(row)

def SHOWVACANTROOMS():

q="select * from rooms where status='Vacant'"

cur1=con.cursor()

cur1.execute(q)

res=cur1.fetchall()

for row in res:

print(row)

11 | P a g e
def SHOWOCCUPIEDROOMS():

q="select booking.room_no,cname,phone from


rooms,booking where status='Occupied' and
rooms.rno=booking.room_no"

cur1=con.cursor()

cur1.execute(q)

res=cr1.fetchall()

for row in res:

print(row)

def BOOKROOM():

print("=============================================
====================")

print("------------------BOOKING A ROOM FOR A


Customer--------------------")

print("=============================================
====================")

cname=input("Enter the Customer Name : ")

idtype=input("Enter the authorized ID submitted(PAN


Card/License/Aadhar Card/Passport) : ")

idno=input("Enter the ID number : ")

address=input("Enter Address of customer: ")

phone=input("Enter Phone number of customer: ")

gender=input("Enter Gender of customer: ")

dcheckin=input("Enter Date of Check in (yyyy-mm-


dd) : ")

12 | P a g e
room_no=int(input("Enter Room number : "))

q="insert into
booking(cname,idtype,idno,address,phone,gender,dateo
fcheckin,room_no) values(%s,%s,%s,%s,%s,%s,%s,%s)"

data=(cname,idtype,idno,address,phone,gender,dchecki
n,room_no)

cur1=con.cursor()

cur1.execute(q,data)

con.commit()

q="update rooms set status='Occupied' where


room_no={}".format(room_no)

cur.execute(q)

con.commit()

print("=============================================
====================")

print("--------------------ROOM BOOKING IS
CONFIRMED--------------------")

print("=============================================
====================")

def CHECKOUT():

room_no=input("Enter the Room Number : ")

q="delete from booking where


room_no={}".format(room_no)

cur1=con.cursor()

cur1.execute(q)

13 | P a g e
q="update rooms set status='Vacant' where
rno={}".format(room_no)

cur1.execute(q)

con.commit()

print("=============================================
====================")

print("--------------------CHECK OUT IS
CONFIRMED--------------------")

print("=============================================
====================")

if con.is_connected():

SHOWMENU()

con.close()

14 | P a g e
OUTPUT

15 | P a g e
16 | P a g e
BIBLIOGRAPHY
 Python for class 12 by Sumita Arora
 https://www.python.org
 https://www.geeksforgeeks.org

17 | P a g e

You might also like