Skip to content

Commit 34d3bc5

Browse files
Implement logic to identify straight angles in getAngleType function
1 parent dc90d42 commit 34d3bc5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function getAngleType(angle) {
1616
}
1717
if(angle>90 && angle<180){
1818
return "Obtuse angle"
19+
}
20+
if(angle===180){
21+
return "Straight angle"
1922
}
2023
// Run the tests, work out what Case 2 is testing, and implement the required code here.
2124
// Then keep going for the other cases, one at a time.
@@ -63,6 +66,8 @@ assertEquals(obtuse,"Obtuse angle")
6366
// When the angle is exactly 180 degrees,
6467
// Then the function should return "Straight angle"
6568
// ====> write your test here, and then add a line to pass the test in the function above
69+
const straight=getAngleType(180);
70+
assertEquals(straight,"Straight angle")
6671

6772
// Case 5: Identify Reflex Angles:
6873
// When the angle is greater than 180 degrees and less than 360 degrees,

0 commit comments

Comments
 (0)