Question: *****************FIX ERRORS IN CODE**************************** import java.text.DecimalFormat; /** * * @return fields * */ public class Dodecahedron { //declare and initialize private String label = ;

*****************FIX ERRORS IN CODE**************************** import java.text.DecimalFormat; /** * * @return fields ******************FIX ERRORS IN CODE****************************

import java.text.DecimalFormat; /** * * @return fields * */ public class Dodecahedron { //declare and initialize private String label = ""; //label of type string private String color = ""; // color of type string private double edge = 0; //edge type of double //Constructor /** * @param label * @param color * @param edge */ public Dodecahedron(String label, String color, double edge) { //use setters to initialize field this.label = label; this.color = color; this.edge = edge; } //getter

/** * * @return String representation of label field */ public String getLabel() { return label; }

/** * * @paramlabel * @return if nut null returns true */ public boolean setLabel(String label) { if (label != null) { this.label = label.trim(); return true; } else { return false; } }

/** * * @return String representation of color field */ public String getColor() { return color; }

/** * * @param color * @return true if not null */ public boolean setColor(String color) { if (color != null) { this.color = color.trim(); return true; } else { return false; } }

/** * @param color * @return double representing the edge field */ public double getEdge() { return edge; }

/** * * @param edge * @return true if is edge >0 */ public boolean setEdge(double edge) { if (edge > 0) { this.edge = edge; return true; } else { return false; } } /** *@return the total surface area * */ public double surfaceArea() { double a = 3 * (Math.sqrt(25 + 10 * Math.sqrt(5))) * Math.pow(edge, 2); return a; } /** * *@return the volume * */ public double volume() { double v = ((15 + 7 * Math.sqrt(5)) / 4) * Math.pow(edge, 3); return v; } /** * *@return the surfaceArea to volume ratio * */ public double surfaceToVolumeRatio() { return surfaceArea() / volume(); }

@Override public String toString() { DecimalFormat decimalFormat = new DecimalFormat("#,##0.0##"); return "Dodecahedron \"" + label + "\"" + " is \"" + color + "\" with 30" + " edges of length " + decimalFormat.format(edge) + " units. " + "\tsurface area = " + decimalFormat.format(surfaceArea()) + " square units " + "\tvolume = " + decimalFormat.format(volume()) + " cubic units. " + "\tsurface/volume ratio = " + decimalFormat.format(surfaceToVolumeRatio()); } }

15 public Dedecahedron String label, String color, double edge) 1 ublic boolean setLabel String label Error [Checkstyle]: -2 Missing a Jarvados comment Error (Checkstyle]: -2 Yaber hides a neid nan edge return true is edge Error [Checkstyle): -2 Tabelfrides a field public boolean setEdge double edge) Error (Checkstyle]: 0 (limit exceeded) Expected @osram teg for "abel if label - rull) this. Lab .labul.tria); return true Error (Checkstyle]: 0 (limit exceeded) edge'de a field Error (Checkstyle) -2 calor hides a field Error (Checkstyle): -2 cdge hvides a fin Error (Checkstyle): 0 (limit exceeded) Expected @param lag for edge if (dy > 0) { return talse; return true; return String representation of color field public String getColor() { return color; return true y not nuli public boolean setColor String color) Error (Checkstyle]: 0 (limit exceeded) Color Prides a field Error (Checkstyle]: 0 (limit exceeded) Expected @param tay for cafor

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!