Question: Write a Java class named Right Triangle that prompts the user to enter three integers that are to be stored in the variables a, b

Write a Java class named Right Triangle that prompts the user to enter three integers that are to be stored in the variables a, b and c. The program determines whether the three integer arguments a, b, and c can represent the lengths of the sides of a right triangle. The program will display the message "represents a right triangle" or "does not represent a right triangle" based on the following considerations. Three integers can represent the lengths of the sides of a right triangle if and only if all three are positive and the square of the largest integer is equal to the sum of the squares of the other two integers. Sample Input/Output The following input values display The following input values display "forms a right triangle" "does not form a right triangle" 3,4,5 3,-4,5 5, 3, 4 -5, -4,-3 6,10,8 0,0,0 10,8,6 5,0,5 12, 5, 13 1,2,3 Write a Java class named RightTriangle that prompts the user to enter three integers that are to be stored in the variables a, b and c. The program determines whether the three integer arguments a, b, and c can represent the lengths of the sides of a right triangle. The program will display the message "represents a right triangle" or "does not represent a right triangle" based on the following considerations. Three integers can represent the lengths of the sides of a right triangle if and only if all three are positive and the square of the largest integer is equal to the sum of the squares of the other two integers. Sample Input/Output The following input values display "forms a right triangle" 3,4,5 The following input values display "does not form a right triangle" 3,-4,5 5,3,4 -5, -4,-3 6, 10,8 0,0,0 10, 8,6 5, 0,5 12, 5, 13 1,2,3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
