You are being asked to build a booking system for the new CodeClan Towers hotel.
Use TDD in Junit to model the Hotel with Java classes, with separate test files for each class.
- Create a
Guest
class to represent a visitor to the hotel, they'll at least need a name, you can add more properties later if and when they become necessary - Create a
RoomType
enum of bedroom types (e.g. Single/Double) and capacity - Create a
Room
abstract class with a capacity and collection ofGuest
s - Create 2 different types of rooms that inherit from
Room
:Bedroom
s will additionally have a room number andRoomType
ConferenceRoom
s will additionally have a name and any other properties you wish.
- Create a
Hotel
class, which has a collection ofBedroom
s and a collection ofConferenceRoom
s. - The
Hotel
will be able check guests in/out of rooms.
- Create a
Booking
class which contains aBedroom
and a number of nights booked. - Create a
bookRoom
method in yourHotel
. This should book a givenBedroom
for a number of nights. This should return a newBooking
object. - Add a nightly rate to your
Bedroom
s and write a method to return the total bill for theBooking
. - Add a
DiningRoom
class with a name, capacity, and collection of guests - Hotel will have a
HashMap
based collection ofDiningRoom
s. -
Hint ^
HashMap<String, DiningRoom>
The String here could be from calling
.getName()
on the instance of DiningRoom
- Add functionality to the
Hotel
so it can return a collection of only the vacantBedroom
s. - Update the check-in process so that
Hotel
will only be able to check guests into emptyBedroom
s. - Any other extensions you can think of!