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.
- 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.
- Call the function twice once for
Ali
and store his BMI in a varaible and once forMohamed
and store his BMI in a variable - Compare the BMI of
Mohamed
andAli
and log who's BMI is higher
Good Luck 😀