Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#3 The class Guest that has the variables held before by a room has been added to the project, also some changes were made to the Project.java class in order to comply with it. The class Guest has the following structure:
The attributes kept default access so the program can access them like before.
#5 The fixes to the OCP principle were made by creating an abstract class Room that has an ArrayList of Guest objects and can add up to maxCapacity int variable amount of elements. SingleRoom has a maxCapacity of 1 and DoubleRoom a max capacity of 2. Also, the code was adjusted to comply with these changes.
The class Room has the following structure and method addGuest():