Question: java 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.

java  java 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. Building -buildingName: String -numberFloors: int -campus Location: String
The Building class The Building class is pretty straight forward as you

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. Building -buildingName: String -numberFloors: int -campus Location: String 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. Building -buildingName: String -numberFloors: int -campusLocation: String +Building (name: String, floors: int, campus: String) +getBuildingName(): String +getCampus (): String +hasMoreFloors (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. +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 retums 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. The R 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 +set RoomCapacity (capacity: int) : void Sets a new capacity for a room (e.g. if the room was expanded during a remodel). +set RoomCapacity (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 + " Building.java Room.java New Full Screen 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!