For this milestone we will update the Hotel class with an array. Create an instance variable called guests of array type Guest. Then create an Overloaded constructor to instantiate the array with the...

1 answer below »

For this milestone we will update the Hotel class with an array. Create an instance variable called guests of array type Guest. Then create an Overloaded constructor to instantiate the array with the numOfRooms to represent the array size.


You will also have been introduced to an method called toString(). Updated all classes to use the toString() method.


Add setters and getters for all instance variables and set the instance variables to private (Guest and Hotel).


Create an UML for Guest and Hotel. Show the diagram on a word doc or PDF.



Submission:


Submit the modified hotel and guest classes. Submit the word or pdf doc showing the UML diagram.

Answered Same DayOct 22, 2021

Answer To: For this milestone we will update the Hotel class with an array. Create an instance variable called...

Neha answered on Oct 29 2021
144 Votes
// Package guestPackage
package hotelPackage;
//Importing Guest class in guestPackage
import gues
tPackage.Guest;
//Class Hotel
public class Hotel
{
    //Instance variables for the Hotel class
    private String hotelName;
    private int numOfRooms;
    Guest guests[] = new Guest[];
    
    public Hotel(int numOfRooms) {
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here