Question: CHALLENGE 3 function triangleAnalyzer ( ) { / / triangleAnalyzer takes three arguments named angleA, angleB, and angleC: / / * If any angle is

CHALLENGE 3
function triangleAnalyzer(){
// triangleAnalyzer takes three arguments named angleA, angleB, and angleC:
//* If any angle is 90 degrees, return the string "this is a right triangle"
//* If any angle is over 90 degrees, return the string "this is an obtuse triangle"
//* If all angles are under 90 degrees, return the string "this is an acute triangle"
// Other conditions that must be met:
//* All angles must be of type number. If not, return the string "all angles must be numbers"
//* All angles must be greater than zero. If not, return the string "all angles must be greater than zero"
//* The three angles must add up to 180. If not, return the string "angles must total 180"
// Hint: the order of the conditions in the pseudo-code above and in the actual code is not necessarily the same
// Hint: It's advised to deal with the other conditions first, like arguments being of the wrong type.
// In the real world, these are considered "edge cases".
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!