Question: I NEED IT quickly plz about 25 mins Implement a Hotel application to maintain a Hotel system of room booking and to display the available
I NEED IT quickly plz about 25 mins
Implement a Hotel application to maintain a Hotel system of room booking and to display the available rooms with their numbers and floor numbers.
- Create Location class as per the class diagram in Figure 1. Provide a constructor for all the fields, getters and setters for each of the class attributes. Add a toString() method to return a formatted string of the values in this form:
- Create Room class and copy the content of the class shown below:
public class Room {
private int number;
private int floor;
private boolean available;
public Room(int number, int floor, boolean available) {
this.number = number;
this.floor = floor;
this.available=available;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getFloor() {
return floor;
}
public void setFloor(int floor) {
this.floor = floor;
}
public boolean isAvailable() {
return available;
}
public void setAvailable(boolean available) {
this.available = available;
}
@Override
public String toString() {
return String.format(" Room Number: %d\tFloor: %d\tAvailable: %b", number, floor, available);
}
}
- Create Hotel class as per the class diagram in Figure Provide getters and setters for the library attributes. Implement the following methods:
- void addRoom(Room room) :adds a room to the rooms list
- void reserveRoom(int roomNumber) : finds the room with the same room number and sets its availability to false
- ArrayList
floorRooms(int floorNumber): returns an array list of all rooms with the same floor number. - String toString() : Returns a formatted string of the library location and the books with their authors in the following format:

Hotel name: Hilton location: Doha, Qatar rooms: [ Room Number: 123 Room Number: 456 Room Number: 666 Floor: 4 Floor: 3 Floor: 4 Available: true, Available: true, Available: false] Room Number: 123 Floor: 4 Available: true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
