Answer to Question #204979 in C++ for Bless

Question #204979

Game Plan Fitness club requires a system that will help their members keep up to date with their BMI after each training session. The system will allow users to enter their weight and height and then calculate each member’s BMI, the system must determine their health status based on the BMI. Use the formula BMI=wieght/(height)^2 , assuming that height is entered in meters and weight is entered in kilograms. Create a function that calculate the BMI, and use a post test loop with weight of -1 to terminate the loop. 



BMI Health status

Less than 18.4. Underweight

Between 18.5 and 24.9. Healthy weight Between 25.0 and 29.9. Overweight Greater than 30.0 Obesity 


1
Expert's answer
2021-06-09T17:33:47-0400
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    float weight, height, BMI;
    while(weight!=-1)
    {
        cout<<"Enter Weight : ";
        cin>>weight;
        cout<<"Enter Height : ";
        cin>>height;
        BMI=weight/pow(height,2);
        weight=-1;
    }
    if(BMI<18.4)
    {
        cout<<"Underweight";
    }
    if(BMI<=24.9 && BMI>=18.5)
    {
        cout<<"Healthy";
    }
    if(BMI<=29.9 && BMI>=25.0)
    {
        cout<<"Overweight";
    }
    if(BMI>=30)
    {
        cout<<"Obesity";
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog