This program will take in the lengths of three (3) sides of a triangle in ascending order. The length values will be integer values only. The program will then determine the type of triangle it is (equilateral, isosceles, right, or non-distinctive) and compute the area of the triangle (as a double value). Recommend you compute the area using Heron’s formula.
Using Java. I am having issues creating a
This program will take in the lengths of three (3) sides of a triangle in ascending order. The length values will be integer values only. The program will then determine the type of triangle it is (equilateral, isosceles, right, or non-distinctive) and compute the area of the triangle (as a double value). Recommend you compute the area using Heron’s formula.
also the error messages must read the following:
The program will also print out an error message and terminate for the following error conditions:
#1 – At least one of the sides is not an integer
#2 – At least one of the sides is not a valid integer value (e.g., zero or less)
#3 – The sides were not entered in ascending order
#4 – The sides cannot form a valid triangle
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images