Skip to content

Commit 3ba023b

Browse files
committed
In-3-Mandatory/1-bmi.js, a code to return the BMI to 1 decimal place has been written
1 parent b7707e3 commit 3ba023b

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
@@ -15,5 +15,11 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
// return the BMI of someone based off their weight and height
19-
}
18+
19+
const bmi = weight/(height*height);
20+
return bmi.toFixed(1);
21+
22+
// return the BMI of someone based on their weight and height
23+
}
24+
25+
console.log("The BMI is",calculateBMI(70, 1.73));

0 commit comments

Comments
 (0)