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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started