Question: Problem 1: [10 marks] Validating triangle (filename: ValidatingTriangle.java ) Design an algorithm and then write a program that reads three edges for a triangle and
Problem 1: [10 marks] Validating triangle (filename: ValidatingTriangle.java)
Design an algorithm and then write a program that reads three edges for a triangle and determines whether the input is valid. The input is valid if the sum of any two edges is greater than the third edge. Get the input from the console and display the output on the console. Here are some sample runs from this program:
Enter the first edge length: 2
Enter the second edge length: 2
Enter the third edge length: 3
Can edges 2.0, 2.0, and 3.0 form a triangle? true
Enter the first edge length: 1
Enter the second edge length: 1
Enter the third edge length: 2
Can edges 1.0, 1.0, and 2.0 form a triangle? false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
