/BMI

Primary LanguageJavaScript

Calculate BMI

Create a function called calculateBMI that calculates the Body Mass Index (BMI) of a person. The BMI is calculated using the following formula:

BMI = weight / (height * height)

where weight is the person's weight in kilograms and height is the person's height in meters.

Your Task 😃:
  1. The function should take in two arguments:
  • weight (a number): representing the weight of the person in kilograms
  • height (a number): representing the height of the person in meters The function should return the BMI calculated as per the above formula.
  1. Call the function twice once for Ali and store his BMI in a varaible and once for Mohamed and store his BMI in a variable
  2. Compare the BMI of Mohamed and Ali and log who's BMI is higher

Good Luck 😀