Skip to content

Commit 487694e

Browse files
Implement reflex angle identification in getAngleType function and add corresponding test case
1 parent def5669 commit 487694e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function getAngleType(angle) {
1212
if (angle < 90) return "Acute angle";
1313
if ((angle > 90) && (angle < 180)) return "Obtuse angle";
1414
if (angle === 180) return "Straight angle";
15+
if ((angle > 180) && (angle < 360)) return "Reflex angle";
16+
1517
// Run the tests, work out what Case 2 is testing, and implement the required code here.
1618
// Then keep going for the other cases, one at a time.
1719
}
@@ -64,4 +66,6 @@ assertEquals(straight, "Straight angle");
6466
// Case 5: Identify Reflex Angles:
6567
// When the angle is greater than 180 degrees and less than 360 degrees,
6668
// Then the function should return "Reflex angle"
67-
// ====> write your test here, and then add a line to pass the test in the function above
69+
// ====> write your test here, and then add a line to pass the test in the function above
70+
const reflex = getAngleType(270);
71+
assertEquals(reflex, "Reflex angle");

0 commit comments

Comments
 (0)