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

Sample Project File 2

Sample project cs

Uploaded by

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

Sample Project File 2

Sample project cs

Uploaded by

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

DAV FERTILIZER PUBLIC SCHOOL

BABRALA

INFORMATICS PRACTICES
PROJECT REPORT
ON
HOTEL MANAGEMENT SYSTEM
[submitted as a part of AISSCE 2019-20]

Guidance : Mr. Surendra Singh


Prepared by : Sandhi Yadav Roll No.: 25662267
Akansha Yadav Roll No.: 25662250
Nandini Varshney Roll No.: 25662260
CERTIFICATE

This is to certify that Project titled ‘Hotel Booking System’ has been
carried out during the academic session 2019-20 by Sandhi Yadav,
Akansha Yadav and Nandini Varshney of class XII Commerce under
my guidance and supervision. The project report is designed as per
the guidelines of Central Board of Secondary Education, and is being
submitted as a part of AISSCE Practical Examination 2019-20
conducted by CBSE.

___________________ ___________________
Signature Internal Examiner Signature External Examiner
Surendra Singh
DAV Fertilizer Public School
Babrala
ACKNOWLEDGEMENT

We undertook this project work, as the part of my class XII


Informatics Practices course. We had tried to apply our best of
knowledge and experience gained during the studies and class
work. However, developing software system is generally a quite
complex and time-consuming process. It requires a systematic
deep knowledge, insight vision and professional approach during
the design of the project. Moreover, the developer always feels
the need, the help and good wishes and support of the people,
who have considerable experience and idea.
The submission of this project work provides me with a great
opportunity to look back and thank all those who have been
directly or indirectly associated in competition of this project work.
Mr. Surendra Singh, my teacher has been a great source of
inspiration for me. We are lucky enough to get an opportunity to
work under his valuable guidance and suggestions and able to
complete this work. We express our sincere thanks and gratitude
to him.
We are also very much thankful to our Principal Sir, Mr. Anand
Swaroop Saraswat for providing us conducive environment and
moral support to complete the project wok.

Sandhi Yadav
Akansha Yadav
Nandini Varshney
Scope and Objectives of the Project

This software project is designed and developed to facilitate the


customers to book hotel electronically and store the booking
details of customers.

The program is mainly consisting of a computerized database for


collection of booking details of customer and an interface to
insert, search, update, delete and display all the booked records.
An application program is tied with MySQl database for easy
access of records. Using application program i.e. front end, we
can store, retrieve and manage all information in proper way.

This application software, being simple in design and working, does


not require much of training to the users, and can be used as a
powerful tool for automating a Hotel Booking System.

During the coding and designing of the software project, Python,


a powerful front end tool and MySQL as a back-end tool are used
as per the requirement of CBSE curriculum of Informatics Practices
(New)
System Implementation

Hardware Used:
Operating System : Windows 10 Pro
Processor : Intel® Core™ i7-6700 CPU @ 3.40 GHz
Memory (RAM) : 8.00 GB
System Type : 64-bit Operating System

Software Used:
Front End : Python 3.7.0
Back End : MySQL 5.4.1
Documentation : MS Word 2016
Database Structure

Field Data Field


Size Constraint
Name Type Description

Auto_Increment,
RNo Int - Room No.
Primary Key

CName Varchar 20 Customer name

Contact Varchar 10 Contact No.

Address of
Address Varchar 50
Customer

Checkin Varchar 10 Check-In Date

CheckOut Varchar 10 Check-Out Date

Adults Int 2 No. of Adults

Children Int 2 No. of Children


Source Code:
#--------------------------------------------------------------------------------------------
# Global Database Connection
#--------------------------------------------------------------------------------------------
import mysql.connector
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="tcdav",\
database="school")
mycursor=mydb.cursor()

#--------------------------------------------------------------------------------------------
# Create Data Table Function
#--------------------------------------------------------------------------------------------
def CreateTable():
try:
mycursor.execute("CREATE TABLE Hotel\
(RNo INT AUTO_INCREMENT PRIMARY KEY,\
cname VARCHAR(20),\
contact VARCHAR(10),\
address VARCHAR(50),\
checkin VARCHAR(10),\
checkout VARCHAR(10),\
adults INT(2),\
children INT(2));")
print("Table created successfully")
except:
print("Table Already Created.")
r=input("Press any key to continue.....")
Source Code:
#--------------------------------------------------------------------------------------------
# Room Booking Function
#--------------------------------------------------------------------------------------------
def Booking():
print()
print("----------------Data Entry----------------")
choice='y'
while(choice=='y' or choice=='Y'):
cn=input("Enter customer's name? ")
pno=int(input("Enter conotact number? "))
add=input("Enter customer's address? ")
ind=input("Enter check in date? ")
outd=input("Enter check out date? ")
ad=int(input("Enter number of adults? "))
chld=int(input("Enter number of children? "))
mycursor = mydb.cursor()
sql = "INSERT INTO Hotel(cname, contact, address, checkin,
checkout, adults, children)\
VALUES (%s, %s, %s, %s, %s, %s, %s)"
val = (cn,pno,add,ind,outd,ad,chld)
mycursor.execute(sql, val)
"""mydb.commit()required to make the changes,
otherwise no changes are made to the table."""
mydb.commit()
print(mycursor.rowcount, "Room booked successfully.")
print()
choice=input("Enter Y or y for more booking? ")
Source Code:
#--------------------------------------------------------------------------------------------
# Show All Booking Function
#--------------------------------------------------------------------------------------------
def ShowAll():
sql="select * from Hotel"
mycursor.execute(sql)
print()
print()
print("All Bookings")
print()
for row in mycursor:
print(row)
print()
print(mycursor.rowcount, "recods found.")
print()
r=input("Press any key to continue.....")

#--------------------------------------------------------------------------------------------
# Room Wise Search Booking Function
#--------------------------------------------------------------------------------------------
def SearchBooking():
rn=int(input("Enter Room Number? "))
sql = "SELECT * FROM Hotel WHERE RNo=%s"
mycursor.execute(sql, (rn,))
myresult = mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("Failed to get record from MySQL table")
r=input("Press any key to continue.....")
Source Code:

#--------------------------------------------------------------------------------------------
# Update Booking Function
#--------------------------------------------------------------------------------------------
def UpdateBooking():
rn=int(input("Room number to update the entry? "))
ind=input("Enter check in date? ")
outd=input("Enter check out date? ")
ad=int(input("Enter number of adults? "))
chld=int(input("Enter number of children? "))
str="UPDATE Hotel SET checkin=%s,checkout=%s, adults=%s,
children=%s where RNo=%s"
val=(ind,outd,ad,chld,rn)
mycursor.execute(str, val)
mydb.commit()
print()
print(mycursor.rowcount, "record updated successfully.")
print()
r=input("Press any key to continue.....")
Source Code:
#--------------------------------------------------------------------------------------------
# Cancel Booking Function
#--------------------------------------------------------------------------------------------
def CancelBooking():
import mysql.connector
from mysql.connector import Error
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="tcdav",\
database="school")
rn=int(input("Enter Room number to cancel booking? "))
mycursor = mydb.cursor()
sql = "DELETE FROM Hotel WHERE RNo = {}".format(rn)
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, "record(s) deleted")
print()
r=input("Press any key to continue.....")
Source Code:
#--------------------------------------------------------------------------------------------
# Menu
#--------------------------------------------------------------------------------------------
while True:
print("----------------------------------------------------------------------")
print("*********** Welcome to Hotel Booking ************")
print("----------------------------------------------------------------------")
print(" 1: Create Data Table")
print(" 2: Book your Room")
print(" 3: Show all Bookings ")
print(" 4: Search Booking(Room wise")
print(" 5: Update Booking")
print(" 6: Cancel Booking")
print(" 7: Exit")
print("---------------------------------------------------------------------")
print()
choice = int(input(" Please enter your choice: "))
if choice == 1 :
CreateTable()
elif choice == 2:
Booking()
elif choice == 3:
ShowAll()
elif choice == 4:
SearchBooking()
elif choice == 5:
UpdateBooking()
elif choice == 6:
CancelBooking()
elif choice == 7:
sys.exit()
else:
print("Error! Invalid choice, try again!")
conti=input("Press any key to continue..")
Menu Output:

Create Data Table Output:

Data Entry Output:


Show All Booking Output:

Room Wise Search Output:

Update Booking Output:

Cancel Booking Output:

Exit Output:

You might also like