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

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 Databases Questions!