QUESTION IMAGE
Question
the formula for calculating your bmi is below. bmi = 703 (weight in pounds) / (height in inches)^2. which line of code will correctly calculate the bmi? select 3 options. bmi = 703 weight / (height height) bmi = 703 weight / height height bmi = (703 weight) / height * 2 bmi = 703 weight / height * 2 bmi = 703 weight / height ^ 2
Step1: Recall the BMI formula
The formula is $BMI = 703\times\frac{\text{weight in pounds}}{(\text{height in inches})^2}$. In code, height squared can be written as height height or height * 2.
Step2: Analyze each option
- Option 1:
bmi = 703 weight / (height height)is correct as it follows the formula. - Option 2:
bmi = 703 weight / height heightis incorrect because in the order of operations, division and multiplication are done from left - to - right. This will not calculate height squared in the denominator as required. - Option 3:
bmi = (703 * weight) / height 2is correct.height 2represents height squared and the overall expression follows the formula. - Option 4:
bmi = 703 weight / height * 2is correct as it is equivalent to the formula. - Option 5:
bmi = 703 * weight / height ^ 2is incorrect as in most programming languages,^is the bitwise XOR operator, not the exponentiation operator.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
- bmi = 703 weight / (height height)
- bmi = (703 weight) / height * 2
- bmi = 703 weight / height * 2