Hi I'm trying to create "a class called HotelReport which, when given a Hotel object will produce a short, textual report describing the name of the hotel, the number of rooms and, for each room, lists the number and size of the beds.", but I'm unsure how to add the rooms and number of beds and get the final report to output, any help?
Hotel Class
import java.util.*;
public class Hotel {
// Hotel Name
private String hotelname;
public void setName(String hotelname) {
this.hotelname = hotelname;
}
public String getName() {
return this.hotelname;
}
// Hotel Rooms
private List<String> hotelRooms = new ArrayList<String>();
public void sethotelRooms(List<String> hotelRooms) {
this.hotelRooms = hotelRooms;
}
public List<String> gethotelRooms() {
return hotelRooms;
}
}
Room Class
import java.util.*;
public class Room {
private int roomNumber;
public Room(int roomNumber) {
this.roomNumber = roomNumber;
}
private static List<Bed> beds = new ArrayList<Bed>();
public Room(List<Bed> beds) {
setBeds(beds);
}
public void setBeds(List<Bed> beds) {
this.beds = beds;
}
public List<Bed> getBeds() {
return beds;
}
public String getFormat() {
return String.format("Beds:\t%s\n", getBeds());
}
}
Bed Class
import java.util.ArrayList;
import java.util.*;
public class Bed {
// size of bed
private int singleBed = 1;
private int doubleBed = 2;
// implement single bed
public int getsingleBed() {
return singleBed;
}
public void setsingleBed() {
this.singleBed = singleBed;
}
// implement double bed
public int getdoubleBed() {
return doubleBed;
}
public void setdoubleBed() {
this.doubleBed = doubleBed;
}
}
HotelReport Class
public class HotelReport {
public static void main(String[] args) {
Hotel hotelRooms = new Hotel();
hotelRooms.setName("Intercontinental");
hotelRooms.addRoom(1,2,3)
}
}