wes d2a2ba9e15 first commit il y a 4 ans
..
README.md d2a2ba9e15 first commit il y a 4 ans
code.cpp d2a2ba9e15 first commit il y a 4 ans
unitTest.cpp d2a2ba9e15 first commit il y a 4 ans

README.md

Missing Third Angle

by Helen Yu tags: algebra, numbers, math

Summary

You are given 2 out of 3 of the angles in a triangle, in degrees. Write a function that classifies the missing angle as either "acute", "right", or "obtuse" based on its degrees. An acute angle is less than 90 degrees. A right angle is exactly 90 degrees. An obtuse angle is greater than 90 degrees (but less than 180 degrees). For example: missingAngle(11, 2

Instructions

You are given 2 out of 3 angles in a triangle, in degrees.

Write a function that classifies the missing angle as either "acute", "right", or "obtuse" based on its degrees.

  • An acute angle is less than 90 degrees.
  • A right angle is exactly 90 degrees.
  • An obtuse angle is greater than 90 degrees (but less than 180 degrees).

For example: missingAngle(11, 20) should return "obtuse", since the missing angle would be 149 degrees, which makes it obtuse.

Examples

missingAngle(27, 59) ➞ "obtuse"

missingAngle(135, 11) ➞ "acute"

missingAngle(45, 45) ➞ "right"

Notes

The sum of angles of any triangle is always 180 degrees.