Restaurant Reservations
In the task, you have to design the management system of a restaurant chain. A Python class named
Restaurant
has to be created with two methods - make_reservation
and order_food
. Then you have to design another class FastFoodRestaurant
which is a child class of Restaurant
and overrides the make_reservation
method to always print We do not take reservations.
.The restaurant has a defined number of tables. Each reservation is assumed to be 1 hour long. The
make_reservation
method should handle this and should print No seats available
if there are no tables free for the requested hour. The method make_reservation
should take 3 parameters - the name of the person, number of tables, and date-time in the format yyyy-mm-dd-hh
. If the reservation is successful, the method should print Reservation made for <name> at <date>
.The
order_food
method should accept an arbitrary number of arguments that represent the ordered items and print a message Order with <item1>, <item2>, ..., <item_n> placed!
.Input | Output |
restaurant = Restaurant('Dining Paradise', 5); restaurant.make_reservation('John', 2, '2023-10-24-19') | Reservation made for John at 2023-10-24-19 |
fast_food = FastFoodRestaurant('Burger World', 5); fast_food.make_reservation('John', 2, '2023-10-24-19'); fast_food.order_food('Burger', 'Soda') | We do not take reservations.
Order with Burger, Soda placed! |
restaurant = Restaurant('Dining Paradise', 1); restaurant.make_reservation('John', 1, '2023-10-24-19'); restaurant.make_reservation('Mary', 2, '2023-10-24-19') | Reservation made for John at 2023-10-24-19
No seats available |
Note that the current time is not relevant to this problem. Assume that all the reservations are valid.
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB