Question

There are a sotall of five classes and one enum required for this project. Over the course of the projeet, it is important that you pay attention to how different responsibilities are separaled between the classes and how they work in coejuncticn to handle a probiem A quick list of the necessary items for this peogram are HotelManagement Class This is the driver class foe your peogram It will cntain a methed for setting up an initial hotel and the main method which will stant the rest of your peogram. HotelMen-Class-This class controls user input ans the main your program. All input and output should be handled theough this class. ? nt of interaction with Hotel Class-Contains the rooms that guests can reserve. Manages the actial creation and Room Class-Represents the places within the hotel in which a guest can reserve and maintains information about the current occupants. Guest Class-Represents the individual who makes a reservation and the person who the reservation is under BedType Enum-Each room has exacily one bed which is either a double, queen or king sized bed. This enum provides comvenient means for dealing with the different types We will go through the requirements for each class in the following sections This class serves two diflerent purposes. First is the initial entry point for your program. It is often best to separate the entry point of a program from other parts of the code. This makes it easier to identify the starting point and also allows other classes to focus on their own responsibilities You need two methods for this class static Hetel createlnitialHotel -this method is in charge of jus creating an initial hote for the program to use. You will need to create a new Hotel object and add an initial set of rooms to that hotel. It is fine to use a small number ofhoecl room four to five should be The main methed-the only responsibilities of the main method are to get the initial hotel from the previous method, create a new Hotel Menu foe that hotel, and then to call the startMenu method HotelMenu Class The HotelMenu class contains all code related to input and output. It is common to separale classes that deal with input and output from other classes that deal peimanly with logic or maintaining data This makes it easier to identify sach code and to make changes to that code when necessary You must have the following instance variables: Scanner ebjeet that will be used for reading input from the user A Hotel object to maintain rooms and reservations A You must have the following public methods: . void startMenu0-This is the method that presents the initial menu when the program first starts up (see User Menus). I is called by the main method when running the program This method will take in a users seloction for the menu and then cal the private handleSelection method to deal with the users selection. It will do this in an infimie loop until the peogram is fisally exited Hotelenu(Hotel hotel)- a parameterized constractor for setting up a new menu for a given Hotel
media%2Fb05%2Fb05d0761-c442-4b03-8b88-c0
media%2Fc1c%2Fc1cda41a-69b0-4c69-8c91-93
media%2F2e0%2F2e01b57d-3ab4-4384-a67d-6c
0 0
Add a comment Improve this question Transcribed image text
Answer #1

HotelManagement.java

public class HotelManagement{

static Hotel createInitialHotel(){

Hotel obj = new Hotel();

obj.addRoom();

}

public static void main(){

Scanner sc=new Scanner(System.in);  

System.out.println("Welcome to Holiday Inn Express");

System.out.println("Please make a selection from the following options:");

System.out.println("1. Make Reservation");

System.out.println("2. Cancel Reservation");

System.out.println("3. List Reservations");

System.out.println("4. List All Rooms");

System.out.println("5. Exit Program");

System.out.println("Selection:");

int selection = sc.nextInt();

switch(selection){

case 1: System.out.println("Enter the Guest Name");

String name =sc.nextInt();  

System.out.println("Enter the size of the party");

int partySize = sc.nextInt();  

System.out.println("Enter the Bed Type");

String BedType = sc.nextInt();  

break;

case 2:

System.out.println("Enter the Guest Name");

String name =sc.nextInt();  

if(){

}

break;

case 3:

case 4:

case 5: System.Exit();

default:

System.out.println("Wrong Selection");

}

}

}

Room.java

public class Room{

int roomNumber;

Guest currentOccupants;

BedType bedType;

public Room(int roomNumber, BedType bedType){

this.roomNumber=roomNumber;

this.currentOccupants=null;

this.bedType=bedType;

}

public boolean reserveRoom(Guest newGuest){

if(newGuest instanceof Guest){

return true;

}

return false;

}

void freeRoom(){

this.Guest=null;

}

boolean isAvailable(){

if(freeRoom())

return true;

else

return false;

}

String toString(){

}

getGuestType(){

currentOccupants.getName();

}

getPartySize(){

currentOccupants.getPartySize();

}

getRoomNumber(){

return roomNumber;

}

getBedType(){

return BedType;

}

setBedType(BedType bedType){

this.bedType=bedType;

}

}

Guest.java

import java.util.Arrays;

public class Guest{

String name;

int partySize;

Object[] items;

final int size;

public void Guest(String name, int partySize){

this.name=name;

this.partySize=partySize;

}

public Guest(Object... values){

this.size=values.length;

this.items=Arrays.copyOf(values,size);

}

public void getName(){

return name;

}

public void setName(String name){

this.name=name;

}

public void getPartySize(){

return partySize;

}

public void setPartySize(int partySize){

this.partySize=partySize;

}

@Override

public String toString(){

return Arrays.toString(items);

}

}

BedType.java

enum BedType(DOUBLE, QUEEN, KING){

DOUBLE=1;

QUEEN=2;

KING=3;

}

Hotel.java

public class Hotel{

int[] rooms;

int currentNoOfRooms;

int currentNumberOfReservations;

String hotelName;

public void Hotel(){

}

public void Hotel(String name, int maxNumberOfRooms){

}

void getName(){

}

void setName(){

}

void addRoom(Room newRoom){

}

boolean makeReservation(Guest newGuest, BedType desiredBedType){

}

boolean cancelReservation(String guestName){

}

void Room[] getRooms(){

}

void Room[] getReservations(){

}

}

Add a comment
Know the answer?
Add Answer to:
There are a sotall of five classes and one enum required for this project. Over the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT