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.

  1. 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:

  1. 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);

}

}

  1. Create Hotel class as per the class diagram in Figure Provide getters and setters for the library attributes. Implement the following methods:
    1. void addRoom(Room room) :adds a room to the rooms list
    2. void reserveRoom(int roomNumber) : finds the room with the same room number and sets its availability to false
    3. ArrayList floorRooms(int floorNumber): returns an array list of all rooms with the same floor number.
    4. String toString() : Returns a formatted string of the library location and the books with their authors in the following format:

I NEED IT quickly plz about 25 mins Implement a Hotel application

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!