0% found this document useful (0 votes)
3 views18 pages

Main Project Ip XII 2026 Abhishek

The document outlines a project on a Hotel Management System developed by Abhishek Singh for the academic year 2024-25, detailing its features such as customer management, room booking, and billing using Python and SQLite. It includes sections for certification, acknowledgment, references, source code, output screens, and hardware/software requirements. The project aims to automate hotel operations to enhance efficiency and customer experience.
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)
3 views18 pages

Main Project Ip XII 2026 Abhishek

The document outlines a project on a Hotel Management System developed by Abhishek Singh for the academic year 2024-25, detailing its features such as customer management, room booking, and billing using Python and SQLite. It includes sections for certification, acknowledgment, references, source code, output screens, and hardware/software requirements. The project aims to automate hotel operations to enhance efficiency and customer experience.
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/ 18

Session 2024-25

Project File Of
Informatics Practices

Hotel Management
System
Submitted By:
Name: Abhishek Singh
Class: XII B
Roll no:
INDEX

S. No Description Page
No.

1 Certificate 01

2 Acknowledgment and Reference 02

3 Introduction to Project 03

4 Source code 04 – 09

5 Output screen 10 – 15

6 Hardware and software 16

requirements
Certificate

This is certify that Abhishek Singh of class XII has worked


successfully under the supervision of Mr. Vishal Kumar
Srivastava during Academic Year
2025-26 on the project Hotel Management System as per
guideline issued by Central Board of Secondary Education
(CBSE).

Vishal Kumar Srivastava Signature of


(Informatics Practices External Examiner
Teacher)

Date: …………………………

Signature of Principal
Acknowledgment
I would like to express my heartfelt gratitude to my teacher,
Vishal Kumar Srivastava, for their valuable guidance and
support throughout this project. I am also thankful to my
school, Scholar’s Academy, for providing the necessary
resources, and to my family and friends for their
encouragement. This project would not have been possible
without their support.

ABHISHEK SINGH
XII B

Reference
1. Class notes,
2. Informatics Practices by Sumita Arora
3. Learn Python.org
4. python.org
5. tutorialspoint.com
6. hospitalitynet.org
7. hotelmanagement.net
Introduction to the Project

Hotel Management System Project


#### Introduction

This Hotel Management System simplifies hotel operations using Python and
SQLite. It manages customer details, room bookings, and billing efficiently.

### Key Features

1. **Customer Management**:
- Add and retrieve customer details.

2. **Room Booking**:
- Book rooms with different pricing options.
- Calculate total booking charges.

3. **Billing**:
- Calculate and display the total bill.

### Conclusion

This project demonstrates a functional hotel management system, automating


key tasks for improved efficiency and customer experience. It’s a practical
application of programming and database management skills.
Source code
import sqlite3
from datetime import datetime

# Establishing the SQLite connection


def SQLiteconnectionCheck():
global connection
try:
connection = sqlite3.connect("hotel_management.db") # SQLite will
create the file if it doesn't exist
cursor = connection.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS C_DETAILS (
CID TEXT PRIMARY KEY,
C_NAME TEXT,
C_ADDRESS TEXT,
C_AGE INT,
C_COUNTRY TEXT,
P_NO TEXT,
C_EMAIL TEXT
)
''')
cursor.execute('''
CREATE TABLE IF NOT EXISTS ROOM_BOOKINGS (
CID TEXT,
ROOM_CHOICE INT,
START_DATE TEXT,
END_DATE TEXT,
TOTAL_PRICE INT,
FOREIGN KEY(CID) REFERENCES C_DETAILS(CID)
)
''')
print("\nSQLite connection established successfully!")
cursor.close()
except sqlite3.Error as err:
print(f"\nError establishing SQLite connection: {err}")
return None
return connection

# Add New Customer


def addNewCustomer():
if connection:
cursor = connection.cursor()
cid = input("Enter Customer ID: ")
name = input("Enter Customer Name: ")
address = input("Enter Customer Address: ")
age = int(input("Enter Customer Age: "))
country = input("Enter Customer Country: ")
phoneno = input("Enter Customer Contact Number: ")
email = input("Enter Customer Email: ")

sql = "INSERT INTO C_DETAILS (CID, C_NAME, C_ADDRESS, C_AGE,


C_COUNTRY, P_NO, C_EMAIL) VALUES (?, ?, ?, ?, ?, ?, ?)"
values = (cid, name, address, age, country, phoneno, email)
cursor.execute(sql, values)
connection.commit()
print("\nNew Customer added successfully!")
cursor.close()
else:
print("\nError establishing SQLite connection!")

# Book Room
def bookRoom():
if connection:
cursor = connection.cursor()
customer_detail = input("Enter Customer ID or Name: ")
cursor.execute("SELECT * FROM C_DETAILS WHERE CID = ? OR
C_NAME = ?", (customer_detail, customer_detail))
customer = cursor.fetchone()

if customer:
cid = customer[0]
else:
print("Customer not found!")
return

print("\n##### We have the following rooms for you #####")


print("1. Ultra Royal > 10000 Rs. per day")
print("2. Royal > 5000 Rs. per day")
print("3. Elite > 3500 Rs. per day")
print("4. Budget > 2500 Rs. per day")
print("5. Exit")

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

if room_choice == 5:
print("Exiting the process. No room booked.")
return

start_date = input("Enter Start Date (YYYY/MM/DD): ")


end_date = input("Enter End Date (YYYY/MM/DD): ")

try:
start_date_obj = datetime.strptime(start_date, '%Y/%m/%d')
end_date_obj = datetime.strptime(end_date, '%Y/%m/%d')
days_of_stay = (end_date_obj - start_date_obj).days

if days_of_stay <= 0:
print("Invalid date range. End date must be after start date.")
return
except ValueError:
print("Invalid date format. Please enter dates in YYYY/MM/DD
format.")
return

if room_choice == 1:
roomRent = days_of_stay * 10000
elif room_choice == 2:
roomRent = days_of_stay * 5000
elif room_choice == 3:
roomRent = days_of_stay * 3500
elif room_choice == 4:
roomRent = days_of_stay * 2500
else:
print("Invalid choice! Exiting the process.")
return

sql = "INSERT INTO ROOM_BOOKINGS (CID, ROOM_CHOICE,


START_DATE, END_DATE, TOTAL_PRICE) VALUES (?, ?, ?, ?, ?)"
values = (cid, room_choice, start_date, end_date, roomRent)
cursor.execute(sql, values)
connection.commit()
print(f"Room booked from {start_date} to {end_date} for {days_of_stay}
days. Total price: Rs. {roomRent}")
cursor.close()
else:
print("\nError establishing SQLite connection!")

#Show Total Bill


def showTotalBill():
if connection:
cursor = connection.cursor()
customer_detail = input("Enter Customer ID or Name: ")
cursor.execute("SELECT * FROM C_DETAILS WHERE CID = ? OR
C_NAME = ?", (customer_detail, customer_detail))
customer = cursor.fetchone()

if customer:
cid = customer[0]
else:
print("Customer not found!")
return

cursor.execute("SELECT TOTAL_PRICE FROM ROOM_BOOKINGS


WHERE CID = ?", (cid,))
result = cursor.fetchone()
if result:
totalAmount = result[0]
else:
print(f"No booking record found for CID {cid}")
totalAmount = 0

print("\n\n********** FINAL BILL **********")


print(f"Customer ID: {cid}")
print("===============================")
print(f"Total Amount: Rs. {totalAmount}")
print("*******************************\n")
cursor.close()
else:
print("\nError establishing SQLite connection!")

# Show Customer
def showCustomerDetails():
if connection:
cursor = connection.cursor()
customer_detail = input("Enter Customer ID or Name: ")
cursor.execute("SELECT * FROM C_DETAILS WHERE CID = ? OR
C_NAME = ?", (customer_detail, customer_detail))
customer = cursor.fetchone()

if customer:
print("\nCustomer found:")
print(f"ID: {customer[0]}")
print(f"Name: {customer[1]}")
print(f"Address: {customer[2]}")
print(f"Age: {customer[3]}")
print(f"Country: {customer[4]}")
print(f"Contact Number: {customer[5]}")
print(f"Email: {customer[6]}")
else:
print("Customer not found!")
cursor.close()
else:
print("\nError establishing SQLite connection!")

# Main Menu
def main():
SQLiteconnectionCheck()
while True:
print("""
1. Add New Customer
2. Book a Room
3. Show Total Bill
4. Show Customer Details
5. Exit
""")
choice = int(input("\nEnter your choice: "))
if choice == 1:
addNewCustomer()
elif choice == 2:
bookRoom()
elif choice == 3:
showTotalBill()
elif choice == 4:
showCustomerDetails()
elif choice == 5:
print("\nThank you for using the system!")
break
else:
print("\nInvalid choice! Please try again.")

if __name__ == "__main__":
main()
Output Screens
Main Screen

ADD NEW CUSTOMER


ROOM BOOKING

TOTAL BILL
DETAILS OF THE CUSTOMER

EXIT
MySQL DATABASE AND TABLES USED IN
THIS PROJECT

DATABASE
C_DETAILS TABLE

ROOM_RENT
Hardware and Software Requirements

1. Hardware Requirement

○ Pentium 3/4/core 2 Duo/Dual core/i3/i5/i7


○ With at least 256 MB RAM
○ 5MB free space on Hard Disk
○ Color Monitor/LCD

2. Software Requirement
○ MS Windows
○ Python with related library used for data analysis
■ Pandas
■ Numpy
■ Matplotlib
○ SQ lite for RDBMS.

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