Compproagrim
Compproagrim
2023-2024
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
______________________
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.
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:
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("(Simple/Double/Twin/Cabana/Studio/Lanai/
Standard suite/Executive suite)")
status= "Vacant"
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():
cur1=con.cursor()
cur1.execute(q)
res=cur1.fetchall()
print(row)
def SHOWVACANTROOMS():
cur1=con.cursor()
cur1.execute(q)
res=cur1.fetchall()
print(row)
11 | P a g e
def SHOWOCCUPIEDROOMS():
cur1=con.cursor()
cur1.execute(q)
res=cr1.fetchall()
print(row)
def BOOKROOM():
print("=============================================
====================")
print("=============================================
====================")
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()
cur.execute(q)
con.commit()
print("=============================================
====================")
print("--------------------ROOM BOOKING IS
CONFIRMED--------------------")
print("=============================================
====================")
def CHECKOUT():
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