Skip to content

Commit cffe689

Browse files
committed
Implemented a BMI calculator.
1 parent 9b6c0a5 commit cffe689

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
// Then when we call this function with the weight and height
1515
// It should return a string of their Body Mass Index to 1 decimal place
1616

17-
function calculateBMI(weight, height) {
17+
//function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19+
//}
20+
function calculateBMI(weight, height) {
21+
squareHieght = height * height;
22+
calculateBMI = Math.round(((weight / squareHieght)) *10 )/10;
23+
return calculateBMI
1924
}
25+
console.log(calculateBMI(70, 1.73))

0 commit comments

Comments
 (0)