- The hotel management system should allow guests to book rooms, check-in, and check-out.
- The system should manage different types of rooms, such as single, double, deluxe, and suite.
- The system should handle room availability and reservation status.
- The system should allow the hotel staff to manage guest information, room assignments, and billing.
- The system should support multiple payment methods, such as cash, credit card, and online payment.
- The system should handle concurrent bookings and ensure data consistency.
- The system should provide reporting and analytics features for hotel management.
- The system should be scalable and handle a large number of rooms and guests.
- The Guest class represents a guest of the hotel, with properties such as ID, name, email, and phone number.
- The Room class represents a room in the hotel, with properties like ID, room type, price, and status. It provides methods to book, check-in, and check-out a room.
- The RoomType enum represents the different types of rooms available in the hotel.
- The RoomStatus enum represents the status of a room, which can be available, booked, or occupied.
- The Reservation class represents a reservation made by a guest for a specific room and date range. It contains properties such as ID, guest, room, check-in date, check-out date, and status. It provides a method to cancel a reservation.
- The ReservationStatus enum represents the status of a reservation, which can be confirmed or cancelled.
- The Payment interface defines the contract for processing payments. It is implemented by concrete payment classes like CashPayment and CreditCardPayment.
- The HotelManagementSystem class is the central component of the hotel management system. It follows the Singleton pattern to ensure only one instance of the system exists. It provides methods to add guests and rooms, book rooms, cancel reservations, check-in, check-out, and process payments. It also handles concurrent access to shared resources using synchronization.
- The HotelManagementSystemDemo class demonstrates the usage of the hotel management system by creating guests, rooms, booking a room, checking in, checking out, and cancelling a reservation.