Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that requests a person\'s weight and height as input and display

ID: 3532846 • Letter: W

Question

Write a program that requests a person's weight and height as input and displays the
person's body mass index.Use the function BMI to calculate the body mass index,
703 times the weight in pounds, divided by the square of the height in inches, and
then rounded to the nearest whole number.


Write a program that requests a person's weight and height as input and displays the person's body mass index.Use the function BMI to calculate the body mass index, 703 times the weight in pounds, divided by the square of the height in inches, and then rounded to the nearest whole number.


Explanation / Answer

#include<iostream>

using namespace std;

int main ()
{
double height = 0.0;
double weight = 0.0;
double bmi = 0.0;

cout << "Enter your height (in inches): ";
cin >> height;

cout << "Enter your weight (in pounds): ";
cin >> weight;
bmi = 703 * weight / (height * height);

if (bmi < 18.5)
{
cout << "Your body weight category is underweight." << endl;
}
else if (bmi = 18.5 < 25)
{
cout << "Your body weight category is normal." << endl;
}
else if (bmi = 25 < 30)
{
cout << "Your body weight category is overweight." << endl;
}
else if (bmi >= 30)
{
cout << "Your body weight category is obese." << endl;
}

system ("pause");
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote