Question: Using Haskell Write and call a function that takes three parameters, a, b, and c, and returns True if a, b, and c are a
Using Haskell
Write and call a function that takes three parameters, a, b, and c, and returns True if a, b, and c are a Pythagorean triple (ie if they are possible lengths for the sides of a right triangle), otherwise False. The function must return True is the parameters are a Pythoagorean triple, irrespective of the order in which they are given; for example, it must return True for 3 4 5 as well as for 5 4 3. Use use the || logical or operator to string together the three cases in which you should return True ( the first case is that a is the square root of (b squared plus c squared)). You will need the built-in sqrt function. Note that == is a test, just as in Java, and returns a boolean. Call your function for several different inputs, including 3 4 5 and 5 4 3 as well as for several for which the function should return false.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
