creating a UML (class diagram along with the appropriate relationship) for the following situation. 1)A dormitory has a name and has several rooms. When a dormitory is built, the name and the number of rooms should be provided. 2)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. 3)The rooms are then automatically created and added to the dormitory, numbered from 1, 2, 3, and so on, representing the room number. 4)Once the room number is assigned to the created room, this information cannot be edited anymore. 5) 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. 6)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.
I need help in creating a UML (class diagram along with the appropriate relationship) for the following situation.
1)A dormitory has a name and has several rooms. When a dormitory is built, the name and the number of rooms should be provided.
2)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.
3)The rooms are then automatically created and added to the dormitory, numbered from 1, 2, 3, and so on, representing the room number.
4)Once the room number is assigned to the created room, this information cannot be edited anymore. 5) 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.
6)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.
Step by step
Solved in 3 steps with 2 images