Question: #include class BMI { private: double height; double weight; public: BMI(double height, double weight) { this->height = height; this->weight = weight; } int BodyMassIndex() {
#include class BMI
{
private:
double height;
double weight;
public:
BMI(double height, double weight)
{
this->height = height;
this->weight = weight;
}
int BodyMassIndex()
{
double bmIndex;
bmIndex = weight / (height * height);
return int(bmIndex + .5);
}
void BMIStatus()
{
int BMIValue = BodyMassIndex(weight, height);
if (BMI < 18)
cout << "Underweight" << endl;
else if (BMI <= 25) cout << "Normal" << endl;
else cout << "Overweight" << endl;
}
};
HOW CAN I CREATE THE MAIN() AND RUN THE CODE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
