We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a696e17 commit 84ed53eCopy full SHA for 84ed53e
Sprint-2/3-mandatory-implement/1-bmi.js
@@ -15,5 +15,14 @@
15
// It should return their Body Mass Index to 1 decimal place
16
17
function calculateBMI(weight, height) {
18
- // return the BMI of someone based off their weight and height
19
-}
+ var bmi = weight / (height * height);
+ var bmis = bmi.toFixed(1);
20
+ return `Your bmi is ${bmis}`;
21
+
22
+ // return the BMI of someone based off their weight and height
23
+}
24
+console.log(calculateBMI(85, 1.75));
25
+// based on the above code: My weight is 85 kg and my height is 1.75m.
26
+// first i squared my height: 1.75 * 1.75 = 3.0625.
27
+// then i divided my weight by the squared height: 85 / 3.0625= 27.8
28
+// so my BMI is `27.8`.
0 commit comments