In mathematics, the triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. Write a function named, prg_question_1 to check whether three sides of given lengths would form a triangle or not. For example, for sides 12.5, 20.8, 15.0 your function must return true whereas for 4.8, 3.0, 12.0 it must return false as 4.8 +3.0 is < 12.

icon
Related questions
Question
In mathematics, the triangle inequality states that for any triangle, the sum of the
lengths of any two sides must be greater than or equal to the length of the remaining
side. Write a function named, prg_question_1 to check whether three sides of given
lengths would form a triangle or not. For example, for sides 12.5, 20.8, 15.0 your
function must return true whereas for 4.8, 3.0, 12.0 it must return false as 4.8 + 3.0 is
< 12.
Do the following:
1. Follow UMPIRE process to get the algorithm. Write only the algorithm as code
comments
2. Implement your function
3. Test your function for the sets of side lengths of units 10, 20, 15 and 4, 4, 10.
Please follow the test criteria given in the code template
Transcribed Image Text:In mathematics, the triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. Write a function named, prg_question_1 to check whether three sides of given lengths would form a triangle or not. For example, for sides 12.5, 20.8, 15.0 your function must return true whereas for 4.8, 3.0, 12.0 it must return false as 4.8 + 3.0 is < 12. Do the following: 1. Follow UMPIRE process to get the algorithm. Write only the algorithm as code comments 2. Implement your function 3. Test your function for the sets of side lengths of units 10, 20, 15 and 4, 4, 10. Please follow the test criteria given in the code template
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer