Skip to content

Commit e6eb715

Browse files
committed
angel type done need to do the tests part
1 parent 3372770 commit e6eb715

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

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

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

1717
function getAngleType(angle) {
18-
// TODO: Implement this function
18+
if (angle > 360)
19+
angleType = "Invalid"
20+
else if (angle > 180){
21+
angleType = "Reflex angle"
22+
}
23+
else if (angle == 180){
24+
angleType = "Straight angle"
25+
}
26+
else if (angle > 90){
27+
angleType = "Obtuse angle"
28+
}
29+
else if ( angle == 90){
30+
angleType = "Right angle"
31+
}
32+
else {
33+
angleType = "Acute angle"
34+
}
35+
36+
return angleType
1937
}
2038

39+
console.log(getAngleType(320));
40+
41+
2142
// The line below allows us to load the getAngleType function into tests in other files.
2243
// This will be useful in the "rewrite tests with jest" step.
2344
module.exports = getAngleType;

0 commit comments

Comments
 (0)