Staycation Booking System in Java
Staycation Booking System in Java
The system manages user inputs by requesting specific details like guest name, dates, and number of guests with sequential prompts and validates numerical choices against available options for rooms. To protect against errors, it verifies the number of guests does not exceed room capacity before proceeding with a booking and handles inappropriate selections by providing a warning or prompt for re-entry. This systematic input handling helps in ensuring that user actions align with available services, safeguarding against common input mistakes.
The system provides immediate feedback for user actions, confirming successful bookings or cancellations and indicating the reason for failed attempts (e.g., staycation is already booked). This transparency builds trust by ensuring users are promptly informed about the status of their actions, contributing positively to user satisfaction. This dynamic and informative feedback loop reduces confusion and increases user confidence in the system's reliability, which is crucial for user satisfaction in a reservation system.
Before finalizing a booking, the system requires the user to input the number of guests. It then checks if this number exceeds the capacity of the selected staycation (using the 'capacity' attribute of the Staycation class). If the number exceeds the allowed capacity, the system denies the booking request and prompts the user to select a larger room, therefore ensuring compliance with guest limitations.
The 'lastBookingSummary' string stores detailed information of the latest booking, including guest name, check-in and check-out dates, room type, and payment method. This summary plays a critical role by providing a clear and structured output that confirms reservation details to the user after a booking has been made. By printing this summary at the end and when the user chooses to finalize their session, it allows users to verify and confirm all the critical elements of their booking promptly.
The Staycation class manages booking through the 'book' method, which checks if a staycation is already booked (using the 'isBooked' boolean attribute) before confirming a new booking to prevent double bookings. For cancellation, the 'cancel' method similarly checks if the staycation is booked before processing a cancellation. This ensures data integrity by preventing state inconsistencies where a staycation could appear both booked and available simultaneously.
The system currently collects payment method details without integrating an actual payment processing system, which limits its functionality to simply recording the user’s chosen method (cash, card, or Gcash) without confirming or validating the transaction. This lack of integration could impact user experience negatively, as users cannot complete payment securely or immediately as part of the booking process, potentially leading to uncertainties about reservation validity or complications during check-in if payment issues arise.
The StaycationBookingSystem enhances user interaction by providing clear prompts and feedback for each action. For instance, it confirms each successful booking or cancellation and handles error cases like double booking or invalid selection gracefully by giving informative error messages. The system also includes a verification step for cancellation (asking users for confirmation) to reduce accidental cancellations. This setup helps prevent errors and improve user experience through clear communication and logical checks.
The system sets the check-in time at 3:00 PM and check-out at 11:00 AM, likely based on common hotel practices that allow for cleaning and preparing rooms for subsequent guests. Altering these times could affect operational management by either increasing downtime between guest stays if extended, potentially reducing availability during peak periods, or requiring better coordination for cleaning and turnover if shortened, impacting staff scheduling and resource allocation. Adjusting these times would thus need to consider both guest convenience and operational efficiency.
The system promotes scalability and flexibility by utilizing Java's ArrayList to manage staycations, allowing for dynamic adjustment of the number of staycation options without restructuring the code significantly. As new Staycation objects are added to this list, the system can handle them uniformly using the consistent method calls (display, book, cancel), thereby supporting expansion, improved functionality, and ease of maintenance as more booking options are introduced.
The StaycationBookingSystem outlines the house rules and reminders, such as no smoking or loud noise after 10 PM, and restricts the number of guests. While making a booking, users are informed about these rules as part of the system's output when displaying the booking summary. Non-compliance, such as damages or excessive guests, may lead to additional fees being charged according to the system's policy for damages, helping to enforce compliance.