Project: Ellipsoid List App Page 4 of 7 Ellipsoid List.java Requirements: Create an Ellipsoid List class that stores the name of the list and an ArrayList of Ellipsoid objects. It also includes methods that return the name of the list, number of Ellipsoid objects in the EllipsoidList, total volume, total surface area, average volume, and average surface for all Ellipsoid objects in the Ellipsoidl.ist. The toString method returns a String containing the name of the list followed by cach Ellipsoid in the ArrayList, and a summary Info method returns summary information about the list (see below). Design: The EllipsoidList class has two fields, a constructor, and methods as outlined below. (1) Fields (or instance variables): (1) a String representing the name of the list and (2) an ArrayList of Ellipsoid objects. These are the only fields (or instance variables) that this class should have, and both should be private. (2) Constructor: Your EllipsoidList class must contain a constructor that accepts a parameter of type String representing the name of the list and a parameter of type ArrayList
representing the list of Ellipsoid objects. These parameters should be used to assign the fields described above (i.e., the instance variables). (3) Methods: The methods for Ellipsoid List are described below. o get Name: Returns a String representing the name of the list. numberOfEllipsoids: Returns an int representing the number of Ellipsoid objects in the Ellipsoidlist. If there are zero Ellipsoid objects in the list, zero should be retumed o totalVolume: Retums a double representing the total volume for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned totalSurfaceArea: Returns a double representing the total surface area for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. averageVolume: Returns a double representing the average volume for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. o averageSurfaceArea: Retums a double representing the average surface area for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. o tostring: Returns a String(does not begin with in) containing the name of the list followed by each Ellipsoid in the ArrayList. In the process of creating the return result. this toString() method should include a while loop that calls the toString() method for cach Ellipsoid object in the list (adding a In before and after each). Be sure to include appropriate newline escape sequences. For an example, see lines through 16 in the output below from EllipsoidListApp for the Ellipsoid data l.ext input file. Note that the toString result should not include the summary items in lines 18 through 24 of the example. These lines represent the return value of the summapInfo method below.] summaryInfo: Returns a String (does not begin with (n) containing the name of the list (which can change depending of the value read from the file) followed by various summary items: number of Ellipsoid objects, total volume, total surface area, average volume, and average surface area. Use"# 00 " as the pattern to format the double Page 4 of 7 Project: Ellipsoid List App Page 5 of 7 values. For an example, see lines 18 through 24 in the output below from Ellipsoid ListApp for the Ellipsoid_data_1.txt input file. The second example below shows the output from Ellipsoid ListApp for the Ellipsoid_data_0.txt input file which contains a list name but no Ellipsoid data. Code and Test: Remember to import java.util.ArrayList. Each of the last five methods above requires that you use a loop (i.e., a while loop) to retrieve each object in the ArrayList. As you implement your Ellipsoid List class, you can compile it and then test it using interactions. However, it may be easier to create a class with a simple main method that creates an EllipsoidList object and calls its methods. Project: Ellipsoid List App Page 4 of 7 Ellipsoid List.java Requirements: Create an Ellipsoid List class that stores the name of the list and an ArrayList of Ellipsoid objects. It also includes methods that return the name of the list, number of Ellipsoid objects in the EllipsoidList, total volume, total surface area, average volume, and average surface for all Ellipsoid objects in the Ellipsoidl.ist. The toString method returns a String containing the name of the list followed by cach Ellipsoid in the ArrayList, and a summary Info method returns summary information about the list (see below). Design: The EllipsoidList class has two fields, a constructor, and methods as outlined below. (1) Fields (or instance variables): (1) a String representing the name of the list and (2) an ArrayList of Ellipsoid objects. These are the only fields (or instance variables) that this class should have, and both should be private. (2) Constructor: Your EllipsoidList class must contain a constructor that accepts a parameter of type String representing the name of the list and a parameter of type ArrayList representing the list of Ellipsoid objects. These parameters should be used to assign the fields described above (i.e., the instance variables). (3) Methods: The methods for Ellipsoid List are described below. o get Name: Returns a String representing the name of the list. numberOfEllipsoids: Returns an int representing the number of Ellipsoid objects in the Ellipsoidlist. If there are zero Ellipsoid objects in the list, zero should be retumed o totalVolume: Retums a double representing the total volume for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned totalSurfaceArea: Returns a double representing the total surface area for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. averageVolume: Returns a double representing the average volume for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. o averageSurfaceArea: Retums a double representing the average surface area for all Ellipsoid objects in the list. If there are zero Ellipsoid objects in the list, zero should be returned. o tostring: Returns a String(does not begin with in) containing the name of the list followed by each Ellipsoid in the ArrayList. In the process of creating the return result. this toString() method should include a while loop that calls the toString() method for cach Ellipsoid object in the list (adding a In before and after each). Be sure to include appropriate newline escape sequences. For an example, see lines through 16 in the output below from EllipsoidListApp for the Ellipsoid data l.ext input file. Note that the toString result should not include the summary items in lines 18 through 24 of the example. These lines represent the return value of the summapInfo method below.] summaryInfo: Returns a String (does not begin with (n) containing the name of the list (which can change depending of the value read from the file) followed by various summary items: number of Ellipsoid objects, total volume, total surface area, average volume, and average surface area. Use"# 00 " as the pattern to format the double Page 4 of 7 Project: Ellipsoid List App Page 5 of 7 values. For an example, see lines 18 through 24 in the output below from Ellipsoid ListApp for the Ellipsoid_data_1.txt input file. The second example below shows the output from Ellipsoid ListApp for the Ellipsoid_data_0.txt input file which contains a list name but no Ellipsoid data. Code and Test: Remember to import java.util.ArrayList. Each of the last five methods above requires that you use a loop (i.e., a while loop) to retrieve each object in the ArrayList. As you implement your Ellipsoid List class, you can compile it and then test it using interactions. However, it may be easier to create a class with a simple main method that creates an EllipsoidList object and calls its methods