Skip to content

Commit ffc428f

Browse files
implement getAngleType function to determine angle types based on input degrees
1 parent 488330c commit ffc428f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
// execute the code to ensure all tests pass.
1616

1717
function getAngleType(angle) {
18-
// TODO: Implement this function
18+
if (angle > 0 && angle < 90) return "Acute angle";
19+
if (angle === 90) return "Right angle";
20+
21+
if (angle > 90 && angle<180) return "Obtuse angle";
22+
if (angle === 180) return "Straight angle";
23+
if (angle>180 &&angle < 360) return "Reflex angle";
24+
return "Invalid angle";
1925
}
2026

2127
// The line below allows us to load the getAngleType function into tests in other files.

0 commit comments

Comments
 (0)