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
  • Create a C# Console app Project in Visual Studios Menu: Room number Amenities Price 111 1...

    Create a C# Console app Project in Visual Studios Menu: Room number Amenities Price 111 1 king size bed $130.00 112,113,114 2 double beds $145.00 211,212 1 queen size bed $125.00 213 1 double bed and 1 sofa bed $170.50 Write a program called HotelReservations that prompts a guest for a room number. Once the room selection is made, display the amenities and price for the room. Allow the guest to continue choosing multiple rooms if desired (displaying the amenities...

  • Objective: To implement the programming languages features discussed in class and to develop a program that...

    Objective: To implement the programming languages features discussed in class and to develop a program that uses Graphical User Interfaces (GUI) that provides a friendly environment for users. Project Assignment Design and implement a Hotel Reservation System. The hotel has two types of rooms. One is regular room that has two beds. Another is deluxe room that has two beds and a safe. The regular room price is $120 per night. The deluxe room is $130 per night. A safe...

  • Write an application for the Shady Rest Hotel; the program determines the price of a room....

    Write an application for the Shady Rest Hotel; the program determines the price of a room. Ask the user to choose 1 for a queen bed, 2 for a king, or 3 for a king and a pullout couch. The output echoes the input and displays the price of the room: $125 for queen, $139 for king, and $165 for suite with king bed and a pullout couch. If the user enters an invalid code, display You selected an invalid...

  • the first question java code eclipse app the second question is java fx gui caculator please...

    the first question java code eclipse app the second question is java fx gui caculator please fast 1. Create project called "YourFirstName_QUID'. Eg. Aliomar_202002345 2. Create two package Q1 and Q2. 3. Add your name and studentID as comments on the top of each Java source file you submit. Question 1. Bookings APP [80 Points-six parts] Implement the following hotel booking system. Use the following class diagram to understand the structure of the system's classes, their attributes operations (or methods),...

  • Project 3 Objective: The purpose of this lab project is to exposes you to using menus,...

    Project 3 Objective: The purpose of this lab project is to exposes you to using menus, selection writing precise functions and working with project leaders. Problem Specification: The PCCC Palace Hotel needs a program to compute and prints a statement of charges for customers. The software designer provided you with the included C++ source and you are asked to complete the code to make a working program using the given logic. The function main () should not change at all....

  • Round Tree Manor is a hotel that provides two types of rooms with three rental classes:...

    Round Tree Manor is a hotel that provides two types of rooms with three rental classes: Super Saver, Deluxe, and Business. The profit per night for each type of room and rental class is as follows: Rental Class Super Saver Deluxe Business Type I (Mountain View) $35 $40 - Room Type II (Street View) $25 $35 $45 Round Tree's management makes a forecast of the demand by rental class for each night in the future. A linear programming model developed...

  • Homework 3: Input Validation 1   Objectives control structures console-based user input using Scanner class writing complete...

    Homework 3: Input Validation 1   Objectives control structures console-based user input using Scanner class writing complete programs using two classes: client and supplier 2   User Interface Specification This is a console-based I/O program. Display should go to System.out (print or println) and the program will get user input using the Scanner class. The flow of execution should be as follows: When the program starts, display a one-line introduction to the user Display a menu with 5 options 1. validate zip...

  • making a file You are tasked with creating a text-based program for storing data on Hotel...

    making a file You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which...

  • Create four classes, Trainee, JumpingCalculator, JumpingTraining, and TrainProgLoader. Save them to Trainee.java, JumpingCalculator.java, JumpingTraining.java, and TrainProgLoader.java....

    Create four classes, Trainee, JumpingCalculator, JumpingTraining, and TrainProgLoader. Save them to Trainee.java, JumpingCalculator.java, JumpingTraining.java, and TrainProgLoader.java. Code the classes as specified as follows. Compile and run to test the program. Trainee Class: This class represents a trainee. Fields : A private int data field named id; A private String data field named name; o a private boolean data field named jumpTrain; o a private static int data field named numOfTrainee; Methods: A constructor that takes id and name as the...

  • Round Tree Manor is a hotel that provides two types of rooms with three rental classes: Super Saver, Deluxe, and Business. The profit per night for each type of room and rental class is as follows:...

    Round Tree Manor is a hotel that provides two types of rooms with three rental classes: Super Saver, Deluxe, and Business. The profit per night for each type of room and rental class is as follows: Rental Class Super Saver Deluxe Business Room Type I (Mountain View) $35 $40 - Type II (Street View) $25 $35 $45 Round Tree's management makes a forecast of the demand by rental class for each night in the future. A linear programming model developed...

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