Question: DodecahedronList.java Requirements: Create a DodecahedronList class that stores the name of the list and an ArrayList of Dodecahedron objects. It also includes methods that return
DodecahedronList.java Requirements: Create a DodecahedronList class that stores the name of the list and an ArrayList of Dodecahedron objects. It also includes methods that return the name of the list, number o Dodecahedro area, average volume, and average surface to volume ratio for all Dodecahedron DodecahedronList. The toString method by each Dodecahedron in the ArrayList, and a summary Info method returns summary information about the list (see below). n objects in the DodecahedronList, total surface area, total volume, average surface returns a String containing the name of the list followed Design: The DodecahedronList class has two fields, a constructor, and methods as outlined below. Fields (or instance variables)(1) a String representing the name of the list ArrayList of Dodecahedron class should have. (1) objects. These are the only fields (or instance variables) that this (2) Constructor: Your DodecahedronList class must contain a constructor that accepts a parameter of type String representing the name of the list and a parameter of type ArrayList- Dodecahedron> representing the list of Dodecahedron objects. These parameters should be used to assign the fields described above (i.e, the instance variables). (3) Methods: The methods for DodecahedronList are described below o getName: Returns a String representing the name of the list. o numberOfDodecahedrons: Returns an int representing the number of Dodecahedron objects in the DodecahedronList. If there are zero Dodecahedron objects in the list, zero should be returned. totalsurfaceArea: Dodecahedron objects in the list. should be returned totalvolume: Returns a double representing the total volumes for all Dodecahedron objects in the list. If there are zero Dodecahedron objects in the list, zero should be returned. Returns a double representing the total surface areas for all o If there are zero Dodecahedroa objects in the list, zero o averageSurfaceArea: Returns a double representing the average surface area for all Dodecahedron objects in the list. If there are zero Dodecahedron objects in the list, zero should be returned. o o averageVolume: Returns a double representing the average volume for all Dodecahedron objects in the list. If there are zero Dodecahedron objects in the list, zero should be returned. o averageSurfaceToVolumeRatio: Returns a double representing the average surface to volume ratio for all Dodecahedron objects in the list. If there are zero Dodecahedron 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 Dodecahedron in the ArrayList. In the process of creating the return result, this toString0 method should include a while loop that calls the toString0 method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
