Question: This procedural program (BMI.ccp) has been written use object-orientanted programming to REWRITE this procedural program. 1) Design a class called BMI and draw it UML

This procedural program (BMI.ccp) has been written use object-orientanted programming to REWRITE this procedural program.

1) Design a class called BMI and draw it UML diagram.

2) Put the class definition in the file BMI.h, its implementation in the file BMI.ccp and write a test file named testBMI.ccp to test your class.

Please use c++ thank you

#include int BodyMassIndex(double weight, double height) // Takes weight in kilograms and height in meters. // Returns the value of BMI rounded to the nearest integer. { double bmIndex; bmIndex = weight / (height * height); return int(bmIndex + .5); // round to the nearest integer } int main() { const double kgInPound = 0.4536, metersInInch = 0.0254; double weight, height; int BMI; cout << "Enter your height in inches ==> "; cin >> height; cout << "Enter your weight in pounds ==> "; cin >> weight; weight = weight * kgInPound; // or: weight *= kgInPounds; height = height * metersInInch; // or: height *= metersInInch; BMI = BodyMassIndex(weight, height); cout << "Your BMI = " << BMI << endl; if (BMI < 18) cout << "Underweight" << endl; else if (BMI <= 25) cout << "Normal" << endl; else cout << "Overweight" << endl; return 0; }

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!