Skip to content

Commit ed5a20c

Browse files
Calculate the BMI and impute the calculated BMI to 1 decimal place.
1 parent 451364c commit ed5a20c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18+
const bmi = weight/(height * height);
19+
return bmi.toFixed(1);
1820
// return the BMI of someone based off their weight and height
19-
}
21+
}
22+
23+
console.log (calculateBMI(90,1.92));
24+
25+
// After running node console.;og printed (24.4).

0 commit comments

Comments
 (0)