Courses‎ > ‎Intro to CS - Half Year‎ > ‎Dyrland-Weaver‎ > ‎Work‎ > ‎

### Work 06: 9/24

posted Sep 24, 2018, 12:23 PM by JonAlf Dyrland-Weaver
 Define the following functions in racket:isBetweenTakes 3 numbers as arguments (let's call them a, b and c)Returns:`#true` if b is greater than a and b is less than c ( a < b < c)`#false` in all other casesExamples:`(isBetween 4 5 6) ==> #true``(isBetween 3 9 7) ==> #false``(isBetween 4 4 9) ==> #false`pythTripleTakes 3 numbers as arguments (let's call them a, b and c)Returns:`#true` if the three parameters could be the sides of a right triangle, with the last parameter being the hypotenuse`#false` in all other casesexamples:`(pythTriple 3 4 5) ==> #true``(pythTriple 6 7 10) ==> #false``(pythTriple 4  3 5) ==> #true``(pythTriple 5 3 4) ==> #false`pythTriple2Takes 3 numbers as parameters (let's call them a, b and c)Returns:`#true` if the three parameters could be the sides of a right triangle, where any of the sides could be the hypotenuse`#false` in all other casesexamples:`(pythTriple2 3 4 5) ==> #true``(pythTriple2 6 7 10) ==> #false``(pythTriple2 4  3 5) ==> #true``(pythTriple2 5 3 4) ==> #true``(pythTriple2 4 5 3) ==> #true`xorThis is known as the exclusive or operatorTakes 2 boolean values as parametersReturns:`#true` if exactly one of the 2 parameters is true`#false` in all other casesExamples:`(xor #true #true) ==> #false``(xor #true #false) ==> #true``(xor #false #true) ==> #true``(xor #false #false) ==> #false``(xor (> 3 4) (<= 5 6)) ==> #true`Challenge Questionxor3Takes 3 boolean values as parametersReturns`#true` if exactly one of the 3 parameters is true`#false` in all other casesSubmit this as booleans