about | help | code help+videos | done | prefs |
The first parameter is the leg of a right triangle and the second parameter is its hypotenuse. The function returns the length of the missing leg. However, if the leg is greater than, or equal to, the hypotenuse, the function should return the string "BAD". missingLeg(5, 3) → 'BAD' missingLeg(3, 5) → 4.0 missingLeg(12, 13) → 5.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 150 Post-solution available
Copyright Nick Parlante 2017 - privacy