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
Guestclass 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
RoomTypeenum of bedroom types (e.g. Single/Double) and capacity - Create a
Roomabstract class with a capacity and collection ofGuests - Create 2 different types of rooms that inherit from
Room:Bedrooms will additionally have a room number andRoomTypeConferenceRooms will additionally have a name and any other properties you wish.
- Create a
Hotelclass, which has a collection ofBedrooms and a collection ofConferenceRooms. - The
Hotelwill be able check guests in/out of rooms.
- Create a
Bookingclass which contains aBedroomand a number of nights booked. - Create a
bookRoommethod in yourHotel. This should book a givenBedroomfor a number of nights. This should return a newBookingobject. - Add a nightly rate to your
Bedrooms and write a method to return the total bill for theBooking. - Add a
DiningRoomclass with a name, capacity, and collection of guests - Hotel will have a
HashMapbased collection ofDiningRooms. -
Hint ^
HashMap<String, DiningRoom>The String here could be from calling
.getName()on the instance of DiningRoom
- Add functionality to the
Hotelso it can return a collection of only the vacantBedrooms. - Update the check-in process so that
Hotelwill only be able to check guests into emptyBedrooms. - Any other extensions you can think of!