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 7d6b8da commit bd99bf5Copy full SHA for bd99bf5
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
-}
+ let heightSquare = height * height;
+ let wheightCal = weight / heightSquare;
20
+ let result1 = wheightCal.toFixed(1);
21
+ //toFixed() returns a string, not a number.
22
+ // need to convert the result to a number
23
+ let tranftoNumber= parseFloat(result1);
24
+ return tranftoNumber;
25
+}
26
+
27
+console.log (calculateBMI (56, 1.65))
28
+// return the BMI of someone based off their weight and height
0 commit comments