Question
Hi can you help me in these method ? java eclipse Hotel class package donottouch; import java.util.ArrayList; public class Hotel { private String name; private
Hi
can you help me in these method ? java eclipse
Hotel class
package donottouch;
import java.util.ArrayList;
public class Hotel {
private String name; private int numberOfFloors; private ArrayList
---------------------------------------------------------------------------------------------------------------------------------------------------
package donottouch;
public class DoubleRoom extends Room implements Wifi{
private int numberOfBeds; private String wifiName; private String wifiPass; private boolean hasWifi; private int wifiEncryption; public DoubleRoom(int floorNum, boolean beachView, int numberOfBeds, boolean hasWifi) { super(floorNum, beachView); this.numberOfBeds = numberOfBeds; this.hasWifi = hasWifi; } public int getNumberOfBeds() { return numberOfBeds; }
@Override public String getWifiName() { return wifiName; }
@Override public String getWifiPass() { return wifiPass; }
@Override public boolean hasWifi() { return hasWifi; }
@Override public void setWifiName(String name) { wifiName = name; }
@Override public void setWifiPass(String pass) { wifiPass = pass; }
@Override public int getWifiEncryption() { return wifiEncryption; }
@Override public void setWifiEncryption(int encrypt) { wifiEncryption = encrypt; } public String toString() { String ans = "Type: Double, Floor number: " + getFloorNumber() + ", Beach view: " + hasBeachView() + ", Number of beds: " + numberOfBeds + ", Has wifi: " + hasWifi; if (hasWifi) ans += ", Wifi name: " + wifiName + ", Wifi pass: " + wifiPass + ", Wifi Encryption: " + ((wifiEncryption == Wifi.WPA_ENCRYPTION)? "WPA" : "WPA2"); return ans; }
}
public static int getNumberofDoubleRooms (Hotel hotel) {//T0D0 2: make this method return the number of Double rooms inside a given hotel return -1;//replace this } public static Hotel getSingleOnly Hotel (Hotel hotel) {//TODO 3: make this method return a new hotel with the same name, and number of floors as the given hotel.//However, the new hotel should ONLY contain the single rooms (no double rooms).//return null.//replace this } public static Wifi getNewRoomWithWifi() {//TODO 4: make this method return a new room with the following Wifi details://(You may fill the other details with your own random information)/* * *Wifi name: Netgear. *Wifi pass: abcdefg *Wifi encryption: WPA */Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started