Write a program that calculates the Body Mass Index (BMI) from a user's weight and height.
The BMI is a measure of some's weight taking into account their height. e.g. If a tall person and a short person both weigh the same amount, the short person is usually more overweight.
The BMI is calculated by dividing a person's weight (in kg) by the square of their height (in m):
Warning you should convert the result to a whole number.
weight = 80
height = 1.75
80 ÷ (1.75 x 1.75) = 26.122448979591837
26
e.g. When you hit run, this is what should happen:
- Check the data type of the inputs.
- Try to use the exponent operator in your code.
- Remember PEMDAS.
- Remember to convert your result to a whole number (int).
Before checking the solution, try copy-pasting your code into this repl:
https://repl.it/@appbrewery/day-2-2-test-your-code
This repl includes my testing code that will check if your code meets this assignment's objectives.