Skip to content

Commit ba98d73

Browse files
committed
bmi updates
1 parent b4e309a commit ba98d73

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// Then when we call this function with the weight and height
1515
// It should return their Body Mass Index to 1 decimal place
1616

17-
function calculateBMI(weight, height) {
18-
// return the BMI of someone based off their weight and height
19-
}
17+
function calculateBmi(weight, height) {
18+
const squareHeight = height * height;
19+
const divide = weight / squareHeight;
20+
// let BMI = divide.toFixed(2);
21+
return Number(divide.toFixed(1));
22+
}
23+
console.log(calculateBmi(70, 1.73));
24+
console.log(typeof calculateBmi(70, 1.73));

0 commit comments

Comments
 (0)