Question: Java: Triangles have exactly three sides. If a triangle has three equal sides it is called an equilateral triangle. If a triangle has exactly two
Java:
Triangles have exactly three sides. If a triangle has three equal sides it is called an equilateral triangle. If a triangle has exactly two equal sides it is called an isosceles triangle. If a triangle has three unequal sides it is called a scalene triangle. The sides of a triangle must have a certain relationship to one another in order for them to form a valid triangle. The relationship is that the sum of any two sides must be strictly greater than the third side.
Write a Java program that prompts the user to enter integer values for the sides of a triangle and then displays the values and the type of triangle they represent. If the user enters values that do not make a valid triangle, or if any values are not greater than zero, your program should display the values entered as well the following error message: The values entered do not make a valid triangle.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
