Skip to content

Commit 97e074f

Browse files
committed
Updatea function that takes two parameters to calculate the BMI
1 parent ebaaadc commit 97e074f

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
@@ -16,4 +16,10 @@
1616

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
}
19+
let bmi = weight / (height * height);
20+
bmi = Number(bmi.toFixed(1));
21+
return bmi;
22+
}
23+
24+
let actualOutput = calculateBMI(70, 1.73);
25+
console.log(actualOutput); // 23.4

0 commit comments

Comments
 (0)