0% found this document useful (0 votes)
19 views26 pages

Cs Project File Final

The document is a project file for a Hotel Management System developed by Apoorva Bijarniya and Nilayansh Upadhyay for the Computer Science session 2024-25 at Delhi Public School, Ranipur. It includes sections on the system's introduction, required hardware and software, source code, and outputs, detailing functionalities such as guest record management, room bookings, and data persistence using MySQL. The project emphasizes the use of Python for development and aims to enhance operational efficiency in hotel management.

Uploaded by

apoorvabijarniya
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)
19 views26 pages

Cs Project File Final

The document is a project file for a Hotel Management System developed by Apoorva Bijarniya and Nilayansh Upadhyay for the Computer Science session 2024-25 at Delhi Public School, Ranipur. It includes sections on the system's introduction, required hardware and software, source code, and outputs, detailing functionalities such as guest record management, room bookings, and data persistence using MySQL. The project emphasizes the use of Python for development and aims to enhance operational efficiency in hotel management.

Uploaded by

apoorvabijarniya
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/ 26

DELHI PUBLIC

SCHOOL
RANIPUR,
HARIDWAR

PROJECT FILE

COMPUTER SCIENCE
SESSION: 2024-25

SUBMITTED BY: SUBMITTED TO:


APOORVA BIJARNIYA MR. NADEEM
XII-F COMPUTER DEPT.
ROLL NO. 11 DPS RANIPUR
ADMN NO. 2011/0057
BOARD ROLL NO: 25624544
INDEX

S No. Description Page No.

1. Certificate 3

2. Acknowledgement & References 4

3. Introduction 5

4. Hotel Management System 13

5. Hardwares and Softwares Required 15

6. List of functions 16

7. Source Code 19

8. Output Screen
CERTIFICATE
This is to certify that Hotel Management Informatics Practices
project is developed by and Nilayansh Upadhyay and Apoorva
Singht under my supervision in the computer lab of in the session
2019-2020. The work done by them is original.

Computer Science teacher


Date: 27/11/2024
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to my computer teacher


Mr Nadeem for his vital support, guidance and encouragement
without which this project would not come forth from my side. Who
helped me completing the project by giving ideas, thoughts and
made this project easy and accurate.
I wish to thank my parents for their undivided support and interest
who inspired me and encouraged me to go my own way, without
which I would be unable to complete my project.
INTRODUCTION

 Introduction to the Hotel Management System


The Hotel Management System is a Python-based program designed
to simplify and automate guest record management for hotels. The
system provides functionalities that cater to the operational needs of a
hotel, including maintaining guest records, handling room bookings,
tracking payment details, and generating insights into guest data
through graphical representations. Its objective is to enhance
operational efficiency by reducing manual effort and ensuring
accurate data storage and retrieval.

Features of the System


1. Menu-Driven Interface
 The system uses a clear, structured menu for user interaction.
 Choices include displaying all guest records, adding new
records, searching for specific data, deleting or updating guest
information, and graphical analysis.
2. Guest Record Management
 Users can add, view, search, delete, or update guest information.
 Key details such as guest ID, name, type of room, duration of
stay, check-in and check-out dates, room number, source of
booking, and payment amount are maintained.
3. Search Functionality
 Multiple criteria for searching guest records:
o By ID, name, type of room, check-in date, room number,
or source of booking.
 Ensures quick and precise access to data.
4. Add and Update Records
 Allows new guest entries with validation for room types and
booking sources.
 Room assignments are automated based on availability within
predefined ranges for different room types.
 Net payment calculations include room charges and taxes (e.g.,
9/50 of the room charge).
5. Data Persistence
 Guest records are stored in a MySQL database, ensuring long-
term data availability.
 Integration with MySQL allows robust handling of large
datasets and facilitates easy updates and queries.
6. Error Handling and Validation
 The system checks for invalid inputs and ensures user prompts
guide corrections.
 Prevents data duplication by verifying unique guest IDs and
room assignments.
 Introduction to Python
Python is a high-level, interpreted programming language known for
its simplicity and versatility. Developed by Guido van Rossum and
first released in 1991, Python emphasizes readability with its clean
syntax and indentation-based structure, making it an excellent choice
for beginners and professionals alike.

Python supports multiple programming paradigms, including


procedural, object-oriented, and functional programming, which
enhances its adaptability across various use cases. It comes with a rich
standard library and a vast ecosystem of third-party libraries, enabling
developers to perform tasks ranging from web development, data
analysis, artificial intelligence, and machine learning to automation
and more.

Key features of Python include:

 Ease of Use: Its simple syntax allows for quicker development


and debugging.

 Cross-Platform Compatibility: Python code can run on


Windows, macOS, and Linux without modification.

 Dynamic Typing: Variables in Python don't require explicit


declaration.

 Community Support: A large and active community provides


extensive documentation, tutorials, and resources.
Python's simplicity and power make it a cornerstone of modern
software development, education, and innovation.
 Introduction to SQL
Structured Query Language (SQL) is a standardized programming
language specifically designed for managing and manipulating
relational databases. Initially developed in the 1970s by IBM, SQL
has become the universal language for database interaction and is
widely supported by database management systems like MySQL,
PostgreSQL, Oracle, and Microsoft SQL Server.

SQL allows users to perform essential database operations, such as:

 Data Retrieval: Querying data using commands like SELECT.

 Data Manipulation: Adding, updating, or deleting data with


INSERT, UPDATE, and DELETE.

 Database Structure Management: Creating and altering database


schemas with CREATE and ALTER.
 Access Control: Granting or restricting permissions with
GRANT and REVOKE.

Key features of SQL include:

 Declarative Nature: Users specify what they want to achieve


rather than how to do it.

 Scalability: SQL efficiently handles large datasets across


industries and applications.

 Interoperability: Works seamlessly with modern programming


languages and tools.
SQL is indispensable for developers and data analysts, providing the
foundation for data-driven decision-making and application
development.
HOTEL MANAGEMENT SYSTEM

A Hotel Management System (HMS) is an integrated software


solution designed to streamline and optimize the operations of a hotel,
resort, or any other accommodation business. It serves as the
backbone of hotel operations by automating and centralizing key
processes such as reservations, front-desk management,
housekeeping, billing, and reporting. By leveraging a hotel
management system, businesses can enhance efficiency, improve
guest experiences, and maximize profitability.

At its core, an HMS facilitates the seamless management of


reservations, whether made online, in person, or via third-party
platforms. It ensures real-time updates to room availability,
preventing overbooking and simplifying the check-in and check-out
processes. These systems are also equipped with modules for
managing guest information, preferences, and requests, enabling
personalized service that fosters loyalty.

Additionally, a robust hotel management system integrates with


financial tools for accurate billing, invoicing, and payment
processing. It also provides detailed analytics and reporting
capabilities, giving hotel managers insights into operational
performance, revenue trends, and guest satisfaction metrics.
Advanced HMS platforms may include features like channel
management, inventory tracking, customer relationship management
(CRM), and integration with point-of-sale (POS) systems for
restaurants and spas.

In the modern hospitality industry, where competition is fierce, an


efficient hotel management system is crucial for meeting customer
expectations, ensuring smooth operations, and staying ahead of the
curve. It not only saves time and reduces manual errors but also
empowers hotels to deliver a seamless and exceptional guest
experience.
HARDWARES AND SOFTWARES
REQUIRED

 HARDWARES
 Desktop Computer / Laptop
 Mobile Phone

 SOFTWARES
 Python (Latest Version)
 MySQL
 MySQL-Connector Python, Requests, Wikipedia-API,
Datetime, Pyfiglet Modules
MYSQL TABLE STRUCTURE

Guest Table:
SOURCE CODE

import mysql.connector

# Connect to the MySQL database


def connect_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="12345678",
database="hotel"
)

def display_menu():
print("\n--- Hotel Management System ---")
print("1. Show all guest records")
print("2. Add a new guest record")
print("3. Search for a guest record")
print("4. Delete a guest record")
print("5. Update a guest record")
print("6. Exit")

def show_all_records():
db = connect_db()
cursor = db.cursor()
query = "SELECT * FROM guest;"
cursor.execute(query)
results = cursor.fetchall()

print("\nGuest Records:")
for row in results:
print(" | ".join(map(str, row)))
db.close()

def add_record():
db = connect_db()
cursor = db.cursor()

guest_id = int(input("Enter Guest ID: "))


name = input("Enter Guest Name: ")
room_type = input("Enter Room Type (single/double/triple/quad): ")
days = int(input("Enter Number of Days: "))
check_in = input("Enter Check-in Date (YYYY-MM-DD): ")
check_out = input("Enter Check-out Date (YYYY-MM-DD): ")
room_no = int(input("Enter Room Number: "))
source = input("Enter Source of Booking (online/offline): ")

# Room rates for different types


rates = {
"single": 2000,
"double": 4000,
"triple": 6000,
"quad": 8000
}
if room_type in rates:
# Calculate the net payment without GST
net_payment = rates[room_type] * days
else:
print("Invalid room type. Record not added.")
db.close()
return

# Adjust the query to match the table columns


query = """INSERT INTO guest
(guestid, nameofguest, type_of_room, noofdays, cidate, codate,
room_no, source_of_booking, netpay)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s);"""

values = (guest_id, name, room_type, days, check_in, check_out, room_no,


source, net_payment)

cursor.execute(query, values)
db.commit()
print("Record added successfully!")
db.close()

def search_record():
db = connect_db()
cursor = db.cursor()
print("1. Search by ID\n2. Search by Name\n3. Search by Room Type")
choice = int(input("Enter your choice: "))
if choice == 1:
guest_id = int(input("Enter Guest ID: "))
query = "SELECT * FROM guest WHERE guestid = %s;"
cursor.execute(query, (guest_id,))
elif choice == 2:
name = input("Enter Guest Name: ")
query = "SELECT * FROM guest WHERE nameofguest LIKE %s;"
cursor.execute(query, ("%" + name + "%",))
elif choice == 3:
room_type = input("Enter Room Type: ")
query = "SELECT * FROM guest WHERE type_of_room = %s;"
cursor.execute(query, (room_type,))
else:
print("Invalid choice.")
db.close()
return

results = cursor.fetchall()
if results:
for row in results:
print(" | ".join(map(str, row)))
else:
print("No records found.")
db.close()

def delete_record():
db = connect_db()
cursor = db.cursor()
guest_id = int(input("Enter Guest ID to delete: "))
query = "DELETE FROM guest WHERE guestid = %s;"
cursor.execute(query, (guest_id,))
db.commit()
if cursor.rowcount > 0:
print("Record deleted successfully!")
else:
print("No record found with the given ID.")
db.close()

def update_record():
db = connect_db()
cursor = db.cursor()
guest_id = int(input("Enter Guest ID to update: "))
print("1. Update Name\n2. Update Room Type\n3. Update Number of Days")
choice = int(input("Enter your choice: "))

if choice == 1:
new_name = input("Enter new name: ")
query = "UPDATE guest SET nameofguest = %s WHERE guestid = %s;"
values = (new_name, guest_id)
elif choice == 2:
new_room_type = input("Enter new room type: ")
query = "UPDATE guest SET type_of_room = %s WHERE guestid = %s;"
values = (new_room_type, guest_id)
elif choice == 3:
new_days = int(input("Enter new number of days: "))
query = "UPDATE guest SET noofdays = %s WHERE guestid = %s;"
values = (new_days, guest_id)
else:
print("Invalid choice.")
db.close()
return

cursor.execute(query, values)
db.commit()
if cursor.rowcount > 0:
print("Record updated successfully!")
else:
print("No record found with the given ID.")
db.close()

# Main program
while True:
display_menu()
try:
choice = int(input("Enter your choice: "))
if choice == 1:
show_all_records()
elif choice == 2:
add_record()
elif choice == 3:
search_record()
elif choice == 4:
delete_record()
elif choice == 5:
update_record()
elif choice == 6:
print("Exiting the program. Goodbye!")
break
else:
print("Invalid choice. Please enter a number between 1 and 6.")
except ValueError:
print("Invalid input. Please enter a number.")
OUTPUTS:

1. ADDING A RECORD
2. DISPLAYING ALL THE RECORDS
3. DELETING A RECORD
4. UPDATING A RECORD
5. SEARCHING THE RECORD
REFERENCE
1. www.google.com/Python project
2. www.wikipedia.com/Python

3. Class Notes.

You might also like