Skip to content

Commit b7fb44c

Browse files
authored
Add calculateBMI function to compute BMI
Implement BMI calculation and log result.
1 parent f9e4e19 commit b7fb44c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
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) {
17+
function calculateBMI(weight, height) {
18+
const bmi = weight / (height * height);
19+
return Number(bmi.toFixed(1));
20+
}
21+
22+
console.log(calculateBMI(88, 1.76));
23+
1824
// return the BMI of someone based off their weight and height
19-
}
25+
}

0 commit comments

Comments
 (0)