Question: c++ //**************************************************************** // BMI Program // This program calculates the body mass index (BMI) given a weight // in pounds and a height in inches

c++
//****************************************************************
// BMI Program
// This program calculates the body mass index (BMI) given a weight
// in pounds and a height in inches and prints a health message
// based on the BMI. Input in English measures.
//*****************************************************************
#include
using namespace std;
int main()
{
const int BMI_CONSTANT = 703; // Constant in non-metric formula
float weight; // Weight in weight
float height; // Height in height
float bodyMassIndex; // Appropriate BMI
bool dataIsOK; // True if data non-negative
// Prompt for and input weight and height
cout
cin >> weight;
cout
cin >> height;
// Test data
if (weight
dataIsOK = false;
else
dataIsOK = true;
if (dataIsOK)
{
// Calculate body mass index
bodyMassIndex = weight * BMI_CONSTANT / (height * height);
// Print message indicating status
cout
cout
if (bodyMassIndex
cout
else if (bodyMassIndex
cout
else if (bodyMassIndex
cout
else
cout
}
else
cout
return 0;
}
 c++ //**************************************************************** // BMI Program // This program calculates the body
mass index (BMI) given a weight // in pounds and a height
in inches and prints a health message // based on the BMI.
Exercise 1: Comple and run program BMI (BMI. eppl, using your own statistics Exercise 2: The cutoff values for the various weight categorles are glven as descrete values as shown below. BMI 20 20-25 26-30 Over 30 Interpretation Underweight Normal Overweight Obese Examine the code of the program and determine the categories that the following BMI values fall into. BMI Value 19.99 20 25.9 30 30.9 31 Interpretation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!