Answer:
<em>This program is written using C++</em>
<em>Comments are used to explain difficult lines</em>
<em>Program starts here</em>
#include<iostream>
using namespace std;
int main()
{
//Declare variables
float BMI, Height,Weight;
// Prompt user for inputs
cout<<"Ener Height (in inches): ";
cin>>Height;
cout<<"Enter Weight (in pounds): ";
cin>>Weight;
//Calculate BMI
BMI = (Weight * 703)/(Height * Height);
cout<<"Your Body Mass Index (BMI) is "<<BMI<<endl;
//Test and print whether user is underweight, overweight or optimal
if(BMI>=18.5&&BMI<=25)
{
cout<<"You have an optimal weight";
}
else if(BMI<18.5)
{
cout<<"You are underweight";
}
else if(BMI>25)
{
cout<<"You are overweight";
}
return 0;
}
<em>See attachment for .cpp source file</em>