2015-10-07

posted Oct 7, 2015, 4:49 AM by Samuel Konstantinovich   [ updated Oct 7, 2015, 6:06 AM ]
Goal: More functions!

Do Now: On paper.
0. Compare with your neighbors after each function, log in and turn the monitor off.
1. Write a function that accepts three side lengths of a triangle a b and c, that assumes c is the longest side. It returns true if that triangle is a right triangle, false otherwise.
(pythCheck 3 4 5)  is #true
(pythCheck 5 4 3)  is #false
(pythCheck 3 4 6)  is #false
2. Write a function that accepts three side lengths of a triangle a b and c, makes no assumptions about relative size, and return true if that triangle is a right triangle, false otherwise.
(isRight 3 4 5) is #true
(isRight 4 5 3) is #true
(isRight 5 13 12) is #true
(isRight 5 13 13) is #false
3. Run drracket, and test your functions on other right triangle sizes. 

Lab04 Military time - On Piazza

Comments