Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9167e67
update 1-key-implement/1-get-angle-type.js
iteddy16 Jun 13, 2025
f9da79b
1-key-implement/2-is-proper-fractions.js
iteddy16 Jun 13, 2025
da2169b
1-key-implement/3-get-card-values.js
iteddy16 Jun 13, 2025
6894bd8
update sprint-1 1-key-exercise/1-count.js
iteddy16 Jun 14, 2025
cb1730c
Sprint-3/1-key-implement/1-get-angle-type.js
iteddy16 Jun 23, 2025
55d8c9f
Updated Sprint-3\2\1-get-angle-type.js
iteddy16 Jun 24, 2025
3a6390e
Updated Sprint-3\2-mandatory-rewrite\1-get-angle-type and test.js
iteddy16 Jun 24, 2025
796a8cf
update sprint-3\2\2-is-proper-fraction.js and test
iteddy16 Jun 24, 2025
b014b98
update sprint-3\2\3-get-card-values.js and test.js
iteddy16 Jun 24, 2025
7e10cb8
update sprint-3\3\count.js and count.test.js
iteddy16 Jun 24, 2025
0771e60
update sprint-3\3\get-ordinal-number.js and test.js
iteddy16 Jun 24, 2025
c8ed1bb
update Sprint-3\3\repeat.js and repeat.test.js
iteddy16 Jun 24, 2025
e9ab61e
add card-validator.js for credit card validation functionality sprint…
iteddy16 Jun 24, 2025
04360b4
update sprint-3\4\find.js
iteddy16 Jun 24, 2025
ce4fb74
update sprint-3\4\password-validator.js
iteddy16 Jun 24, 2025
63dda1e
Updates fro sprint-3/1-get-angle-type, 2-is-proper-fraction, and 3-ge…
iteddy16 Jul 9, 2025
ab8f199
update the getCardValue function
iteddy16 Jul 9, 2025
d96efd6
updated sprint-3/1-get-angle-type
iteddy16 Jul 9, 2025
1fc4d18
updates for get angle and get card
iteddy16 Jul 9, 2025
3ea90b1
update sprint-3/3-mandatory practice/count and count.test.js
iteddy16 Jul 9, 2025
76a9808
updates sprint-3/get-ordinal-numbers.js
iteddy16 Jul 9, 2025
5ed0d66
update sprint-3/find.js
iteddy16 Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update 1-key-implement/1-get-angle-type.js
  • Loading branch information
iteddy16 committed Jun 13, 2025
commit 9167e674beba4483c8d8a0f288ec8f16f102d235
37 changes: 34 additions & 3 deletions Sprint-3/1-key-implement/1-get-angle-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,22 @@
// Then, write the next test! :) Go through this process until all the cases are implemented

function getAngleType(angle) {
if (angle === 90) return "Right angle";
// read to the end, complete line 36, then pass your test here
if (angle === 90) return "Right angle";
if (angle < 90) return "Acute angle";
if (angle > 90 && angle < 180) return "Obtuse angle";
if (angle === 180) return "Straight angle";
if (angle > 180 && angle < 360) return "Reflex angle";
// If the angle is not in any of the above categories, we can return a default value
return "Unknown angle type";
// Note: This function currently does not handle angles outside the range of 0 to 360 degrees.
// If you want to handle angles greater than or equal to 360 degrees, you can modify the function accordingly.
// For example, you could add a case for angles greater than or equal to 360 degrees.
// If you want to handle negative angles, you can also add a case for that.
// If you want to handle angles that are not numbers, you can add a case for that as well.
// You can also add a case for angles that are not numbers, such as strings or null values.
// If you want to handle angles that are not numbers, you can add a case for that as well.

// read to the end, complete line 36, then pass your test here
}

// we're going to use this helper function to make our assertions easier to read
Expand All @@ -32,25 +46,42 @@ function assertEquals(actualOutput, targetOutput) {
// Then the function should return "Right angle"
const right = getAngleType(90);
assertEquals(right, "Right angle");
//console.log("Right angle test passed!");
// ====> write your test here, and then add a line to pass the test in the function above
console.log(getAngleType(90)); // This should log "Right angle"

// Case 2: Identify Acute Angles:
// When the angle is less than 90 degrees,
// Then the function should return "Acute angle"
const acute = getAngleType(45);
assertEquals(acute, "Acute angle");
console.log(getAngleType(45)); // This should log "Acute angle"

// Case 3: Identify Obtuse Angles:
// When the angle is greater than 90 degrees and less than 180 degrees,
// Then the function should return "Obtuse angle"
const obtuse = getAngleType(120);
assertEquals(obtuse, "Obtuse angle");
console.log(getAngleType(120)); // This should log "Obtuse angle"
// ====> write your test here, and then add a line to pass the test in the function above

// Case 4: Identify Straight Angles:
// When the angle is exactly 180 degrees,
// Then the function should return "Straight angle"
const straight = getAngleType(180);
assertEquals(straight, "Straight angle");
console.log(getAngleType(180)); // This should log "Straight angle"

// ====> write your test here, and then add a line to pass the test in the function above

// Case 5: Identify Reflex Angles:
// When the angle is greater than 180 degrees and less than 360 degrees,
// Then the function should return "Reflex angle"
// ====> write your test here, and then add a line to pass the test in the function above
const reflex = getAngleType(270);
assertEquals(reflex, "Reflex angle");
console.log(getAngleType(270)); // This should log "Reflex angle"

// ====> write your test here, and then add a line to pass the test in the function above
const above_reflex = getAngleType(380);
assertEquals(above_reflex, "Unknown angle type");
console.log(getAngleType(380)); // This should log "unknown angle type"