Hotel_Booking_System_Report
Hotel_Booking_System_Report
1. Introduction
This report explains the implementation of a Hotel Booking System using Python Object-
Oriented Programming (OOP). The system allows hotels to manage their rooms, check
availability, book rooms, and release rooms efficiently. The code leverages OOP principles
such as classes, objects, and methods.
2. Code Overview
The Python script consists of two main classes: HotelRoom and Hotel. Each class represents
a distinct aspect of the hotel booking system.
3. Features
- Add rooms to the hotel.
- Check availability of rooms based on type.
- Book a room using its room number.
- Release a booked room.
4. Code Explanation
Below is the Python code implementing the Hotel Booking System:
class HotelRoom:
def __init__(self, room_number, room_type, price_per_night):
self.room_number = room_number
self.room_type = room_type
self.price_per_night = price_per_night
self.is_available = True
def book_room(self):
if self.is_available:
self.is_available = False
return True
else:
return False
def release_room(self):
self.is_available = True
class Hotel:
def __init__(self, name, location):
self.name = name
self.location = location
self.rooms = []
5. Example Usage
The script demonstrates the functionality with an example. It adds three rooms to a hotel,
checks availability, books a room, and releases it. Below is a sample output:
6. Conclusion
This Python-based Hotel Booking System simplifies room management for hotels. The
modular design allows easy scalability and integration into larger systems.