Skip to content

Commit 3eff2ca

Browse files
committed
get-angle-type is sorted.
1 parent 721fe57 commit 3eff2ca

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Sprint-3/1-key-implement/1-get-angle-type.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
// Then, write the next test! :) Go through this process until all the cases are implemented
99

1010
function getAngleType(angle) {
11-
if (angle === 90) return "Right angle";
11+
if (angle === 90) return "Right angle";
12+
if (angle < 90) return "Acute angle";
13+
if (angle > 90 && angle < 180) return "Obtuse angle";
14+
if (angle === 180) return "Straight angle";
15+
if (angle > 180 && angle < 360) return "Reflex angle";
1216
// read to the end, complete line 36, then pass your test here
1317
}
1418

@@ -44,13 +48,16 @@ assertEquals(acute, "Acute angle");
4448
// Then the function should return "Obtuse angle"
4549
const obtuse = getAngleType(120);
4650
// ====> write your test here, and then add a line to pass the test in the function above
47-
51+
assertEquals(obtuse, "Obtuse angle");
4852
// Case 4: Identify Straight Angles:
4953
// When the angle is exactly 180 degrees,
5054
// Then the function should return "Straight angle"
5155
// ====> write your test here, and then add a line to pass the test in the function above
52-
56+
const straight = getAngleType(180);
57+
assertEquals(straight, "Straight angle");
5358
// Case 5: Identify Reflex Angles:
5459
// When the angle is greater than 180 degrees and less than 360 degrees,
5560
// Then the function should return "Reflex angle"
56-
// ====> write your test here, and then add a line to pass the test in the function above
61+
// ====> write your test here, and then add a line to pass the test in the function above
62+
const reflex = getAngleType(270);
63+
assertEquals(reflex, "Reflex angle");

0 commit comments

Comments
 (0)