write a c++ program where you calculate the BMI using formula weight(kg) / [height(m)]^2
need to include arrays
and if statements:
less than 15 very severely under weight
between 15 and 16 severely under weight
between 16 and 18.5 underweight
between 18.5 and 25 healthy
between 25 and 30 overweight
between 30 and 35 obese
display message outside main
#include <iostream>
using namespace std;
double getBMI(double w, double h){
return (w/(h*h));
}
int main()
{
double w,h,bmi;
cout<<"Enter weight: ";
cin>>w;
cout<<"Enter height: ";
cin>>h;
bmi = getBMI(w,h);
cout<<"BMI = "<<bmi;
cout<<endl;
if(bmi < 15){
cout<<("very severely under weight");
} else if(bmi <= 16) {
cout<<("severely under weight");
} else if (bmi < 18.5) {
cout<<("underweight");
} else if (bmi < 25) {
cout<<("healthy");
} else if (bmi < 30) {
cout<<("overweight");
} else {
cout<<("obese");
}
cout<<endl;
return 0;
}


write a c++ program where you calculate the BMI using formula weight(kg) / [height(m)]^2 need to...