Question: Hello, I need help with my Java exercise. Thank you in advance. PROBLEM 2: Room for More [30 points] Now that you've got the students
Hello, I need help with my Java exercise. Thank you in advance.

![PROBLEM 2: Room for More [30 points] Now that you've got the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66e3060e70c4e_25366e3060de1222.jpg)


PROBLEM 2: Room for More [30 points] Now that you've got the students sorted, you need to give them a room to study in. The next task is to finish off the Building and Room classes based on the UML diagrams and descriptions below. The Building class The Building class is pretty straight forward as you can see below. You can tackle this even before you're finished with your Student class in problem 1. tackle this en Building -buildingName: String -numberFloors: int -campus Location: String +Building (name: String, floors: int, campus: String) +getBuildingName(): String +getCampus (): String thasMoreFloors (otherBuilding: Building): int +toString(): String Description of methods from the Building class: +Building (name: String, floors: int, campus: String) Constructs a building with building name, number of floors and located on the specified campus name. +getBuildingName(): String Returns the building name. +get Campus (): String Returns a campus that a building is located on. +hasMoreFloors (otherBuilding: Building): int Compares the number of floors that the building has to another Building object. It returns the number of floors that it has more than the other one. If taller, the number is positive (i.e. returning 3 implies that it has more floors that then "other building"). If equal, the two buildings are of the same height. If negative, the other building is the taller of the two. +toString(): String Overrides the existing string representation of the object to be: building-name + " building (" + num-floors + " floors), " + campus + " campus" The Room class The Room class relies on the Building class as previously created. Room -building: Building -roomNumber: int -roomCapacity: int +Room (building: Building, room: int, capacity: int) +getBuilding(): Building +getRoomCapacity (): int +setRoomCapacity (capacity: int): void +toString(): String Description of methods for the Room class: +Room (building: Building, room: int, capacity: int) Constructs a room in the designated Building, and with the specified room number and capacity. +get Building(): Building Returns the building in which the room is located. +getRoomCapacity (): int Returns the integer room capacity +setRoomCapacity (capacity: int): void Sets a new capacity for a room (e.g. if the room was expanded during a remodel). +toString(): String Overrides the existing string representation of the object to be: building-name + " building, Room" + roomNumber + " (seats " + capacity + ")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
