Recall & Review
beginner
What is the main responsibility of the Hotel class in a hotel booking system?The Hotel class manages hotel details like name, location, and a list of rooms it contains. It acts as a container for rooms and provides methods to add or find rooms.Click to reveal answer
beginner
What attributes are typically included in the Room class?
The Room class usually includes attributes like room number, type (single, double, suite), price, and availability status.Click to reveal answer
intermediate
How does the Booking class relate to Hotel and Room classes?The Booking class represents a reservation and links a customer to a specific Room in a Hotel for a date range. It manages booking details like check-in and check-out dates.Click to reveal answer
intermediate
Why is it important to check room availability before creating a Booking?
Checking room availability prevents double-booking the same room for overlapping dates, ensuring a reliable and consistent booking system.
Click to reveal answer
advanced
What design principle helps keep Hotel, Room, and Booking classes organized and maintainable?
Single Responsibility Principle: each class should have one clear responsibility, making the system easier to understand and modify.Click to reveal answer
Which class should store the price of a hotel room?
✗ Incorrect
The Room class holds details specific to each room, including its price.
What does the Booking class primarily represent?
✗ Incorrect
Booking represents a reservation linking a customer to a room for specific dates.
Which method is essential in the Hotel class to support booking?
✗ Incorrect
Checking room availability is crucial before making a booking.
Why should the Booking class include check-in and check-out dates?
✗ Incorrect
Check-in and check-out dates define the length of the reservation.
Which design principle suggests each class should have one responsibility?
✗ Incorrect
Single Responsibility Principle states that a class should have only one reason to change.
Explain how Hotel, Room, and Booking classes interact in a hotel booking system.
Think about who owns what and how bookings are made.
You got /4 concepts.
Describe the key attributes and methods you would include in the Room class.
Focus on what defines a room and how it can be managed.
You got /5 concepts.