diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js index 9e05a871e2..16c48e830d 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js @@ -16,6 +16,30 @@ function getAngleType(angle) { // TODO: Implement this function + if (angle>0 && angle<90) + { +return "Acute angle"; + } + else if (angle==90) + { + return "Right angle"; + } + else if (angle>90 && angle<180) + { + return "Obtuse angle"; + } + else if (angle==180) + { + return "Straight angle"; + } + else if (angle>180 && angle<360) + { + return "Reflex angle"; + } + else + { + return "Invalid angle"; + } } // The line below allows us to load the getAngleType function into tests in other files. @@ -35,3 +59,30 @@ function assertEquals(actualOutput, targetOutput) { // Example: Identify Right Angles const right = getAngleType(90); assertEquals(right, "Right angle"); + +const acute = getAngleType(1); +assertEquals(acute,"Acute angle"); + +const obtuse = getAngleType(90.5); +assertEquals(obtuse,"Obtuse angle"); + +const straight = getAngleType(180); +assertEquals(straight,"Straight angle"); + +const reflex = getAngleType(359.9); +assertEquals(reflex,"Reflex angle"); + +const invalid = getAngleType(380); +assertEquals(invalid,"Invalid angle"); + +const straight2 = getAngleType(180); +assertEquals(straight2,"Straight angle"); + +const invalid2 = getAngleType(360); +assertEquals(invalid2,"Invalid angle"); + +const acute2 = getAngleType(0.1); +assertEquals(acute2,"Acute angle"); + +const invalid3 = getAngleType(0); +assertEquals(invalid3,"Invalid angle"); \ No newline at end of file diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js index 970cb9b641..3fd208bf6c 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -12,6 +12,14 @@ function isProperFraction(numerator, denominator) { // TODO: Implement this function + numerator = Math.abs(numerator); + denominator = Math.abs(denominator); + if (numerator= 2 && numvalue <= 10) { + return numvalue; + } } // The line below allows us to load the getCardValue function into tests in other files. @@ -41,6 +60,14 @@ function assertEquals(actualOutput, targetOutput) { // Examples: assertEquals(getCardValue("9♠"), 9); +assertEquals(getCardValue("A♥"),11); +assertEquals(getCardValue("10♠"),10); + + +assertEquals(getCardValue("2♠"), 2); +assertEquals(getCardValue("K♠"), 10); +assertEquals(getCardValue("q♦"), 10); +assertEquals(getCardValue("J♣"), 10); // Handling invalid cards try { getCardValue("invalid");