Skip to content

Commit f67441c

Browse files
committed
completed exercise and test has passed with no errors 1-get-angle-type.js
1 parent 3372770 commit f67441c

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,31 @@
1414
// After you have implemented the function, write tests to cover all the cases, and
1515
// execute the code to ensure all tests pass.
1616

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

39+
// TODO: Implement this function
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)