Question: *** Method to return the type of triangle represented by three sides. * This only checks for whether a triangle is equilateral, isosceles, or scalene

 *** Method to return the type of triangle represented by three
*** Method to return the type of triangle represented by three sides.
* This only checks for whether a triangle is equilateral, isosceles, or scalene
* @return a string with a description of the type of triangle
* @param side_a the first side
* @param side_b the second side, etc.
*/
public String TriangleType(int side_a, int b, int c)
{
if (side_a == b) return TRIANGLE_ISOSCELES;
if (side_a == c) {
return TRIANGLE_ISOSCELES;
}
if (side_a == b && b == c)
{
return EQUILATERAL_TRIANGLE;
}
return SCALENE_triangle;}

Run the following code and take notes on the coding standards and practices it violates and explain. *** Method to return the type of triangle represented by three sides. * This only checks for whether a triangle is equilateral, isosceles, or scalene * @return a string with a description of the type of triangle @param side_a the first side @param side_b the second side, etc. public String Triangle Type(int side_a, int b, int c) { if (side_a == b) return TRIANGLE_ISOSCELES; if (side_a == 0) { return TRIANGLE_ISOSCELES; } if (side_a == b && b == c) { return EQUILATERAL_TRIANGLE; } return SCALENE_triangle;}

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!