[solved]-Trianglejava Load Default Template 1 Public Class Triangle Fixme Private Instance Variable Q39028601





Triangle.java Load default template… 1 public class Triangle // FIXME: private instance variables base and height go here private double base; private double height; // constructor public Triangle (double b, double h) base = b; height = h; public static void main(String[] args) // FIXME: set the base public void setbase( double b) base = b; // FIXME: set the height public void setHeight(double h) height = h; // FIXME: get the base public double getBase) return base; // FIXME: get the height public double getHeight return height; // FIXME: get the area of triangle public double getArea() return 0.5*height*base; 43 } // end class Triangle 2: Unit test 0/3 Test triangle.setBase(3.0) and triangle.getBase() Compilation failed zyLabsUnitTest.java:14: error: cannot find symbol triangle.setBase (base * 1.5); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error 4: Unit test 0/3 Test triangle(4.0, 2.0), then setting base * 2.0 and height/2.0 Compilation failed zyLabsUnitTest.java:13: error: cannot find symbol triangle.setBase (base * 2.0); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error We were unable to transcribe this image8: Unit test ^ 0/2 Test triangle(15.0, 4.5), then setting base * 2.0 and height/2.0 Compilation failed zyLabsUnitTest.java:13: error: cannot find symbol triangle.setBase (base * 2.0); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error Show transcribed image text Triangle.java Load default template… 1 public class Triangle // FIXME: private instance variables base and height go here private double base; private double height; // constructor public Triangle (double b, double h) base = b; height = h; public static void main(String[] args) // FIXME: set the base public void setbase( double b) base = b; // FIXME: set the height public void setHeight(double h) height = h; // FIXME: get the base public double getBase) return base; // FIXME: get the height public double getHeight return height; // FIXME: get the area of triangle public double getArea() return 0.5*height*base; 43 } // end class Triangle
2: Unit test 0/3 Test triangle.setBase(3.0) and triangle.getBase() Compilation failed zyLabsUnitTest.java:14: error: cannot find symbol triangle.setBase (base * 1.5); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error
4: Unit test 0/3 Test triangle(4.0, 2.0), then setting base * 2.0 and height/2.0 Compilation failed zyLabsUnitTest.java:13: error: cannot find symbol triangle.setBase (base * 2.0); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error
8: Unit test ^ 0/2 Test triangle(15.0, 4.5), then setting base * 2.0 and height/2.0 Compilation failed zyLabsUnitTest.java:13: error: cannot find symbol triangle.setBase (base * 2.0); Compilation failed symbol: method setBase (double) location: variable triangle of type Triangle 1 error
Expert Answer
Answer to Triangle.java Load default template… 1 public class Triangle // FIXME: private instance variables base and height go h… . . .
OR

