File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Sprint-3/1-implement-and-rewrite-tests/implement Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 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.
2344module . exports = getAngleType ;
You can’t perform that action at this time.
0 commit comments