Created
October 23, 2020 18:07
-
-
Save wedburst/dfc3072fa55b85fc8e4ca705517305e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function bmiCalculator (weight, height) { | |
| var interpretation = weight / Math.pow(height, 2); | |
| return Math.round(interpretation); | |
| } | |
| var body = bmiCalculator(85,1.8); | |
| if(body < 18.5 ){ | |
| console.log("your weight is: " + body + " You are underweight"); | |
| } | |
| if(body >= 18.5 && body <= 24.9){ | |
| console.log("your weight is: " + body + " so you have a normal weight"); | |
| } | |
| // if(body > 24.9){ | |
| // console.log("your weight is: " + body + " You are normal"); | |
| // } | |
| if(body > 25.9 && body < 29.9){ | |
| console.log("your weight is: " + body + " Overweight"); | |
| } | |
| if(body > 30 && body < 34.9){ | |
| console.log("your weight is: " + body + " Obese"); | |
| } | |
| if(body > 35){ | |
| console.log("your weight is: " + body + " Extramely obese"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment