Question: How do I implement a HasMoreFloors method in my object class? public class Building{ private String buildingName; private int numberFloors; private String campusLocation; public Building(String
How do I implement a HasMoreFloors method in my object class?

public class Building{ private String buildingName; private int numberFloors; private String campusLocation; public Building(String name, int floors, String campus){ this.buildingName = name; this.numberFloors = floors; this.campusLocation = campus; }
public hasMoreFloors(Building otherBuilding){
}
+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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
