Question: JAVASCRIPT PLZ Write a function that takes the three angles of a triangle as arguments, and returns one of the following four strings representing the
JAVASCRIPT PLZ
Write a function that takes the three angles of a triangle as arguments, and returns one of the following four strings representing the triangle's classification: 'right', 'acute', 'obtuse', or 'invalid'. (Note: Valid triangles have three angles that sum to 180 degrees.) You may assume that all angles have integer values, so you do not have to worry about floating point errors. You may also assume that the arguments are in degrees.
EXAMPLE:
triangle(60, 70, 50); // "acute" triangle(30, 90, 60); // "right" triangle(120, 50, 10); // "obtuse" triangle(0, 90, 90); // "invalid" triangle(50, 50, 50); // "invalid"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
