Skip to content

Commit 4fa6e04

Browse files
committed
function to calculate bmi has been implemented
1 parent 15b01b6 commit 4fa6e04

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
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+
let weight = 80; // in kg
18+
let height = 1.73; // in metres
19+
1720
function calculateBMI(weight, height) {
1821
// return the BMI of someone based off their weight and height
19-
}
22+
let bmi = weight / (height * height);
23+
return bmi;
24+
}
25+
26+
console.log(calculateBMI(weight, height).toFixed(1)); // should return 26.7

0 commit comments

Comments
 (0)