Based on the following information I need help in coding in Java for the appropriate classes. *)A dormitory has a name and has several rooms. When a dormitory is built, the name and the number of rooms should be provided. *)In some cases, the maximum capacity of the rooms is also provided. If there is no maximum capacity set, each room can accommodate at most 6 guests. *)The rooms are then automatically created and added to the dormitory, numbered from 1, 2, 3, and so on, representing the room number. Once the room number is assigned to the created room, this info
Based on the following information I need help in coding in Java for the appropriate classes.
*)A dormitory has a name and has several rooms. When a dormitory is built, the name and the number of rooms should be provided.
*)In some cases, the maximum capacity of the rooms is also provided. If there is no maximum capacity set, each room can accommodate at most 6 guests.
*)The rooms are then automatically created and added to the dormitory, numbered from 1, 2, 3, and so on, representing the room number. Once the room number is assigned to the created room, this information cannot be edited anymore.
*)The dormitory can accept guests into a given room number. Each guest has a name and nationality. If the capacity is full or an invalid room number is provided, the guest will not be added and this method returns false. Otherwise, this method returns true.
*)The dormitory also has a method to return the guests in a given room number. If an invalid room number is provided, the method will return null.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)