Skip to content

Commit 53bf711

Browse files
committed
Add BMI checks for multiple inputs
1 parent 6270b24 commit 53bf711

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎Sprint-3/3-mandatory-implement/1-bmi.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@
1717
function calculateBMI(weight, height) {
1818
return (weight / (height * height)).toFixed(1);
1919
}
20+
2021
console.log(calculateBMI(52, 1.63));
22+
23+
console.assert(
24+
calculateBMI(70, 1.73) === "23.4",
25+
"Expected BMI for 70kg and 1.73m to be 23.4",
26+
);
27+
console.assert(
28+
calculateBMI(80, 1.8) === "24.7",
29+
"Expected BMI for 80kg and 1.8m to be 24.7",
30+
);
31+
console.assert(
32+
calculateBMI(60, 1.6) === "23.4",
33+
"Expected BMI for 60kg and 1.6m to be 23.4",
34+
);

0 commit comments

Comments
 (0)