Skip to content

Instantly share code, notes, and snippets.

@o0pmitev
Created December 10, 2018 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save o0pmitev/39cfa36d62b6e978e33acf7b9a58d77d to your computer and use it in GitHub Desktop.
Save o0pmitev/39cfa36d62b6e978e33acf7b9a58d77d to your computer and use it in GitHub Desktop.
js training
// bmiCalculator
console.log("Calcilate your Body Mass Index(BMI)");
console.log("************************************");
let weightKg = 67;
let heightCm = 177;
//bmi calculation
const bmi = weightKg/((heightCm/100)*(heightCm/100));
console.log(`Your BMI is ${bmi}`)
const summ = () => {
if(bmi < 18.5){
console.log('Underweight');
} else if(bmi < 25){
console.log('Perfect')
} else if(bmi <= 30){
console.log('Overweight');
} else {
console.log('Obese');
}
}
summ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment