Menu

[Solved]Java Language Please Part 1 Hotel Create Abstract Hotelroom Class Int Capacity Roomtype En Q37202507

Java language please.

Part 1 – Hotel

Create an abstract HotelRoom class that has a int capacity,roomType(enum works well here)   Boolean hasMicroFridge,double/ float averageNightlyPrice, and Boolean isVacant fields.

Create a DoubleHotelRooms that extends the HotelRoom thecapacity should always be 4. Create a KingHotelRooms that extendsthe HotelRoom the capacity should always be 3. Create aDoubleSuiteHotelRooms that extends the DoubleHotelRooms the roomalways has a mircofridge. Create a KingSuiteHotelRooms that extendsthe KingHotelRooms the room always has a mircofridge.

Create a Hotel class with an ArrayList of HotelRooms. Create ano-arg constructor that will initialize in the ArrayList with 5rooms of each type. It will set the averageNightlyPrice for aDoubleHotelRooms to $95.50, KingHotelRooms to $96.50,DoubleSuiteHotelRooms to $105.36, and KingSuiteHotelRooms to$104.52. Create bookDoubleHotelRoom, bookDoubleSuiteHotelRoom,bookKingHotelRoom, bookKingSuiteHotelRoom methods that return theaverageNightlyPrice of room and sets next available room of thattype isVacant field to false. Create a hasVacancy method that willreturn true if the hotel still has rooms available and falseotherwise.

Create getters, setters, equals, and toStrings for allclasses.

Create a driver class that will allow the user to book a room oftheir choosing for x-number of nights and the total for a stay.

Part 2 – Hotel Revisited

Add to the Part1 of the project the following exceptions:NoVacancyException and OverCapacityException. TheNoVacancyException should be thrown when the hotel has no roomsleft. The OverCapacityException should be thrown when a guest’sparty is too large for the room.

Add the following classes: Guest, Reservation. The Guest classshould have the following fields: String firstName, StringlastName, String address, int numberChildrenInParty, and intnumberAdultsInParty. The Reservation class should have a intreservationNumber, status (Hint: enum works well here),double/float totalCostForTheStay, a roomType (enum works wellhere), a guest and a hotel room.

Add the following interfaces: BookHotelRoom andReservationStatus. The BookHotelRoom interface should generate areservation. (Hint: a Hotel should be able to book a hotel room).The ReservationStatus interface should have a checkIn, and checkOutmethod. The checkIn method should be called once the guest checkInand will cause the room to be occupied and set the status of thereservation to valid. Also the room isVacant field should be false.The checkOut method should be called when the user is ready tocheckout of a room and will cause the room to be vacant and set thestatus of the Reservation to invalid.

Create getters, setters, equals, and toStrings for allclasses.

Create a driver class that will be menu driven with options to:create a Reservation with a room of their choosing for x-number ofnights and print the total for a stay, see all current Reservationsfor the Hotel, check in and out a guest from a Hotel room. The usershould only be using Reservations to book different rooms at thehotel. The programmer should handle any room overcapacity or novacancies with feedback to the user, and the program should notstop.

Part 3 – A Reservation Application

Use the classes implemented in Parts 1 and 2 to create a GUIapplication to accommodate a front desk agent creatingreservations, checking in and out guests, and displaying currentreservations. Upon startup the application should search for a“hotelRooms.dat”, it should populate an instance of the HotelClass. (Hint: if the file doesn’t exist create a new instance) Uponshutdown the application should write the current instance of theHotel Class to a file named “hotelRooms.dat”. The programmer shouldhandle any exceptions and not stop.

Expert Answer


Answer to Java language please. Part 1 – Hotel Create an abstract HotelRoom class that has a int capacity, roomType(enum works w… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *