File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Sprint-3/1-implement-and-rewrite-tests/implement Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1515// execute the code to ensure all tests pass.
1616
1717function getAngleType ( angle ) {
18- // TODO: Implement this function
18+ if ( angle < 90 ) {
19+ return "Acute angle" ;
20+ } else if ( angle === 90 ) {
21+ return "Right angle" ;
22+ } else if ( angle > 90 && angle < 180 ) {
23+ return "Obtuse angle" ;
24+ } else if ( angle === 180 ) {
25+ return "Straight angle" ;
26+ } else if ( angle > 180 && angle < 360 ) {
27+ return "Reflex angle" ;
28+ }
29+ return "invalid angle" ;
30+
1931}
2032
2133// The line below allows us to load the getAngleType function into tests in other files.
@@ -35,3 +47,4 @@ function assertEquals(actualOutput, targetOutput) {
3547// Example: Identify Right Angles
3648const right = getAngleType ( 90 ) ;
3749assertEquals ( right , "Right angle" ) ;
50+
You can’t perform that action at this time.
0 commit comments