Welcome to the Hotel Reservation System! This application is designed to help manage hotel bookings, reservations, and room assignments efficiently. The system is built using Java and demonstrates key object-oriented programming (OOP) concepts such as Classes, Inheritance, Encapsulation, and Polymorphism.
- Hotel: Represents the hotel itself, managing a collection of rooms and reservations.
- Room: A general representation of any room in the hotel. Contains basic attributes like room number, type, and availability.
- Reservation: Handles the reservation details, including guest information, room assigned, and duration of stay.
- SingleRoom: A subclass of
Room
, representing a room specifically designed for single occupancy. - SuiteRoom: A subclass of
Room
, representing a luxurious suite with more amenities.
- Reservation Details: The details of a reservation (like guest information, check-in/check-out dates, etc.) are encapsulated within the
Reservation
class. This ensures that sensitive information is protected and only accessible through controlled methods.
- Booking Methods: The system uses polymorphism to handle different types of room bookings. Whether it's a single room or a suite, the booking process can be managed uniformly through method overriding.
- Clone the repository:
git clone https://github.com/your-username/hotel-reservation-system.git
- Navigate to the project directory:
cd hotel-reservation-system
- Compile the project:
javac -d bin src/*.java
- Run the application:
java -cp bin Main
- Create Rooms: Initialize the hotel with various types of rooms (SingleRoom, SuiteRoom).
- Make Reservations: Use the system to make reservations for guests by specifying the room type, check-in, and check-out dates.
- View Reservations: List all current reservations and their details.
- Manage Rooms: Check room availability, assign rooms to guests, and handle check-ins/check-outs.
- Encapsulation: Guest and reservation details are protected within their respective classes.
- Inheritance:
SingleRoom
andSuiteRoom
inherit common properties and methods from theRoom
class. - Polymorphism: The
bookRoom
method demonstrates polymorphism by handling different room types seamlessly.
Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.