Question: Follow the Documentation Strings in House.java to complete this assignment. Methods: int totalSquareFeet() Calculates the total square feet by summing the individual square footage from

Follow the Documentation Strings in House.java to complete this assignment. Methods: intFollow the Documentation Strings in House.java to complete this assignment. Methods: int totalSquareFeet() Calculates the total square feet by summing the individual square footage from each Room in the Array rooms. double averageSquareFootagePerRoom() Calculates the average square feet per room by averaging the individual square footage from each Room in the Array rooms. String[] roomNames() Returns a String Array of Room names sorted in Lexicographic order.

Here is House.java

public class House { private Room[] rooms; // Constructor Do Not Modify public House(Room[] rooms) { this.rooms = rooms; } /*** * Calculates the sum of the squareFeet of all the rooms in rooms * * @return sum */ public int totalSquareFeet() { return 0; } /*** * Calculates the average square footage per room based on the ratio of square * footage of each room and the total number of rooms * * @return average */ public double averageSquareFootagePerRoom() { return 0; } /*** * Returns a SORTED list of room names in lexicographic order * * @return sorted String Array */ public String[] roomNames() { return null; } }

Here is Room.java

public class Room { private String name; private int length, width; public Room() { this.name = "undefined"; this.length = -1; this.width = -1; } public Room(String name, int length, int width) { this.name = name.toLowerCase(); this.length = length; this.width = width; } public int getLength() { return this.length; } public int getWidth() { return this.width; } public String getName() { return this.name; } public int getSquareFeet() { return this.length * this.width; } } 

1. Computation 1. int totalSquare Feet() 2. double average Square FootagePerRoom() 2. Sort 1. String[] roomNames() Follow the Documentation Strings in House.java to complete this assignment. Methods: 1. int totalSquare Feet() fon 1. Calculates the total square feet by summing the individual square footage from each Room in the Array rooms. 2. double averageSquare Footage PerRoom() 1. Calculates the average square feet per room by averaging the individual square footage from each Room in the Array rooms. 3. String[] roomNames() 1. Returns a String Array of Room names sorted in Lexicographic order

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!