Write a program TriangleIdentifier.java
that has the user enter the lengths of three sides of a triangle, s1
, s2
, and s3
. The program should then identify the type of triangle it is and print out the String “equilateral”, “isosceles”, or “scalene”, as appropriate.
Write a method getType()
that takes the sides of the triangle as inputs and returns a String
value indicating the type of the triangle. Call this method from the main()
program.
Ensure that the three sides can make a triangle. If the user enters 2, 3, and 7, for example, those side lengths can’t form a triangle. If the three sides can’t form a triangle, the program should print out the String “ERROR”.