Skip to content

Commit 3e6cc95

Browse files
committed
Implement 1 get angle type
1 parent 0db6b3c commit 3e6cc95

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@ function getAngleType(angle) {
1212
return "Right angle";
1313
}
1414
// Run the tests, work out what Case 2 is testing, and implement the required code here.
15-
// Then keep going for the other cases, one at a time.
15+
// Then keep going for the other cases, one at a time.
16+
if (angle < 90) {
17+
return "Acute angle";
18+
}
19+
if (angle > 90 && angle < 180) {
20+
return "Obtuse angle";
21+
}
22+
if (angle === 180) {
23+
return "Straight angle";
24+
}
25+
if (angle > 180 && angle < 360) {
26+
return "Reflex angle";
27+
}
1628
}
1729

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

0 commit comments

Comments
 (0)