0% found this document useful (0 votes)
35 views27 pages

Hotel Booking

Uploaded by

sharmaji4212
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)
35 views27 pages

Hotel Booking

Uploaded by

sharmaji4212
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/ 27

J.B.

MEMORIAL MANAS ACADEMY

ACADMEIC YEAR: 2023-24


PROJECT REPORT ON

HOTEL BOOKING SYSTEM

ROLL NO :
NAME : SANIDHYA KHARAYAT
CLASS : XII “A”
SUBJECT : COMPUTER SCIENCE
SUB CODE : 083
PROJECT GUIDE : MR. DEVENDRA MAHORI
CONTENTS
S No. NAME Page no.

1. Certificate 3

2. Acknowledgement 4

3. Project analysis 6

4. About python 7

5. About MySQL 8

6. Introduction and objectives 9

7. Python connectivity with SQL 10

8. Source Code & Output Screen 12

9. Enhancement and feature ideas 23

10. Bibliography 24
J.B. MEMORIAL MANAS ACADEMY

CERTIFICATE
This is to certify that SANIDHYA KHARAYAT Roll no. __ has
successfully completed the project work entitled HOTEL BOOKING
SYSTEM in the subject computer science (083) laid down in the
regulation of CBSE for the purpose of practical examination in Class XII to
be held in J.B. MEMORIAL MANAS ACADEMY on ________________

(MR. Devendra Mahori)


PGT Computer Science

Examiner:
Name:
Signature:
Acknowledgment
Apart from the effort of me, the success of any project depends largely on
the encouragement and guidelines of many other. I take this opportunity to
express my gratitude to the people who have been instrumental in the
successful completion of this project.

I express deep sense of gratitude to almighty god for giving me


strength for the successful completion of the project.

I express my heartfelt gratitude to my parents for constant


encouragement while carrying out this project.

I gratefully acknowledge the contribution of the individuals who


contributed in bringing this project up to this level, who contributes to look
after me despite my flaws.

I express my deep sense of gratitude to the luminary the principle,


MANAS ACADEMY PITHORAGARH who has been continuously motivating
and extending their helping hand to us.

I am overwhelmed to express my thanks to the administrative office


for providing me an infrastructure and moral support while carrying out
this project in the school.

My sincere thanks Mr. Devendra Mahori (PGT CS), A guide, Mentor all
of the above a friends, who critically reviewed my project and helped in
solving each and every problem, occurred during implementation of the
project.

The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for the
success of the project. I am grateful for their constant support and help.
PROJECT ON

HOTEL BOOKING
SYSTEM
SESSION : 2023-2024
PROJECT ANALYSIS

This application program is specially designed for the HOTEL


BOOKING. It includes the basic setof all the functions
required to ease the restaurant management which are used
to reduce time waste and increases efficiency .
It includes –

➢ Adding of new room


➢ Faster reservation of room
➢ Easy modification customer detail
➢ Cancelling of booked room

I have looked for some basic requirements required for hotel for online
booking so on that I have written this program.

This program uses PYTHON and MYSQL as platform to carry out the
task.
ABOuT PYTHON
Python is a high-level, interpreted programming language that emphasizes
readability and simplicity. Developed by Guido van Rossum and first released
in 1991, Python has become one of the most popular and versatile programming
languages. Some key features include:
• Readability: Python's syntax is designed to be clear and readable, making it
accessible for both beginners and experienced developers.
• Versatility: Python supports multiple programming paradigms, including
procedural, object-oriented, and functional programming. This versatility makes
it suitable for a wide range of applications.
• Dynamic Typing: Python is dynamically typed, allowing for flexibility
in variable assignments and function parameters.
• Open Source: Python is an open-source language, fostering
collaboration and allowing developers to contribute to its
development.
• Interpreted Language: Python is an interpreted language, which means
that code can be executed line by line. This facilitates quick testing and
prototyping.

In summary, Python's simplicity, readability, versatility, and strong community


support contribute to its widespread adoption for various applications, ranging
from web
development and data science to artificial intelligence and automation.
ABOUT MY SQL

MySQL is a widely-used open-source relational database


management system (RDBMS). Developed by Oracle Corporation,
it's known for its reliability, performance, and ease of use. Key
features include:
Relational Database: MySQL follows a relational database model,
organizing data into tables with predefined relationships.
Open Source: As an open-source RDBMS, MySQL is freely available,
fostering widespread adoption and community collaboration.
Cross-Platform Compatibility: MySQL is compatible with various
operating systems, ensuring versatility across different environments.
SQL Language Support: It supports the Structured Query Language (SQL),
providing a standardized means to interact with databases.
Scalability: MySQL caters to both small-scale applications and large-scale
enterprise databases, offering scalability to meet diverse needs.

In summary, MySQL is a powerful and versatile relational database


management system, widely used for its performance, reliability, and
strong community support
INTRODUCTION:
The software is used to maintain the records of all the available
dishes in the menu , to add a new dish to menu for the restaurant , to
check the amount dish holds.

OBJECTIVE :

The objective of this project is to let students apply the


programming knowledge to the real-world situation and
exposed the students how programming skills helps in
developing a good software.
C0NNECTING PYTHON TO SQL –

import mysql.connector

# Replace these values with your database credentials

host = 'localhost'

user = 'root'

password = 'sanidhya@417'

database = 'booking'

port = 3306

try:

# Connect to the MySQL database

conn = mysql.connector.connect(

host=host,

database=database,

user=user,

password=password,

port=port,

auth_plugin='mysql_native_password'

)
# Check if the connection is successful

if conn.is_connected():

print("Connection established successfully")

# Your SQL operations go here

except mysql.connector.Error as e:

print(f"Error: {e}")

finally:

# Close the connection when done, whether it was successful or not

if 'conn' in locals() and conn.is_connected():

conn.close()
function
Output
Source code:-
import sqlite3

# Connect to SQLite database

conn = sqlite3.connect('hotel.db')

cursor = conn.cursor()

# Create table to store rooms

cursor.execute('''

CREATE TABLE IF NOT EXISTS rooms (

room_number INTEGER PRIMARY KEY,

available BOOLEAN DEFAULT 1

''')

# Create table to store bookings

cursor.execute('''

CREATE TABLE IF NOT EXISTS bookings (

id INTEGER PRIMARY KEY AUTOINCREMENT,

customer_name TEXT,

room_number INTEGER,
status TEXT DEFAULT 'Booked',

FOREIGN KEY (room_number) REFERENCES


rooms(room_number)

''')

# Function to create a room

def create_room(room_number):

cursor.execute('INSERT INTO rooms (room_number) VALUES (?)',


(room_number,))

conn.commit()

# Function to display available rooms

def display_available_rooms():

cursor.execute('SELECT room_number FROM rooms WHERE


available = 1')

available_rooms = cursor.fetchall()

print("Available Rooms:")

for room in available_rooms:

print(room[0])

# Function to display all Booking

def view_booking():

cursor.execute('SELECT customer_name, room_number from


bookings')

available_rooms = cursor.fetchall()
print("All Booking Details:")

for room in available_rooms:

print(room)

# Function to book a room

def book_room(customer_name, room_number):

cursor.execute('UPDATE rooms SET available = 0 WHERE


room_number = ?', (room_number,))

cursor.execute('INSERT INTO bookings (customer_name,


room_number) VALUES (?, ?)', (customer_name, room_number))

conn.commit()

print(f"Room {room_number} booked for {customer_name}")

# Function to cancel booking

def cancel_booking(customer_name, room_number):

cursor.execute('DELETE FROM bookings WHERE customer_name


= ? AND room_number = ?', (customer_name, room_number))

cursor.execute('UPDATE rooms SET available = 1 WHERE


room_number = ?', (room_number,))

conn.commit()

print(f"Booking for room {room_number} by {customer_name}


cancelled.")

# Function to update booking


def update_booking(customer_name, old_room_number,
new_room_number):

cancel_booking(customer_name, old_room_number)

book_room(customer_name, new_room_number)

# usage:

if __name__ == "__main__":

print()

print("H O T E L M A N A G E M E N T S Y S T E M")

print(‘*’*100)

while True:

print("1. Add a room")

print("2. View Available Room")

print("3. Add a Booking")

print("4. View All Booking")

print("5. Cancel Booking")

print("6. Update Booking")

print("7. Exit")

choice = input("Enter your choice: ")

if choice == '1':

a=int(input("enter no. of new room"))

create_room(a)

elif choice=='2':
display_available_rooms()

elif choice =='3':

cust=input('please enter customer name')

rno=int(input('please enter room no. you want to book'))

book_room(cust, rno)

elif choice=='4':

view_booking()

elif choice =='5':

cust=input('please enter customer name who want to cancel


booking')

rno=int(input('please enter room no. you want to cancel'))

cancel_booking(cust, rno)

elif choice =='6':

cust=input('please enter customer name who want to update


booking')

rno=int(input('please enter old room no.'))

ono=int(input('please enter new room no.'))

update_booking(cust,rno,ono)

elif choice=='7':

break;

else:

print('please try again!!')


# Close the connection

conn.close()

Output window:-
ADDING NEW ROOM
VIEW AVAILABLE ROOMS
ADD A BOOKING
VIEW ALL BOOKING
CANCEL BOOKING
UPDATE BOOKING
ENHANCEMENTS AND fEATuRE IDEAS-
 EASY MENU SETUP –
Menu configuration in the hotel has to be simple and easy . No one wants the terminal or
server to reboot when you want to make minor changes in it. This goes a long way in ensuring
profitability and long term success.

USER AUTHENTICATION -

Implement a user authentication system to distinguish between administrators and regular


users.this can allow administrator to perform additional actions,such as adding and modifying the
booking menu system.

 EMAIL NOTIFICATIONS –
Implement an email notification system to remind users of upcoming due dates, overdue booking
, when a reserved room becomes available.

 DATA BACKUP AND RECOVERY-


Set up regular data backups and implement a recovery mechanism to ensure data integrity and
availability.

 SPEED –
Speed is an important factor to consider. A slow system can be chaotic for everyone. The speed also
increases ease .

 SECURITY -
Security is most important ensures that data must be secure and the software must be safe from the
attack of the hackers.
BIBLIOGRAPHY

❖ To develop the project following sources were used:

1. Computer science with SumitraArora

2. https://www.google.com

3. My friends, teacher and Youtube

4. School Lab .

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy