Question: C++ Write a program that calculates body mass index. Construct class BMI. The class has private members : float height, float weight, float bmi and

C++

Write a program that calculates body mass index. Construct class BMI. The class has private members : float height, float weight, float bmi and public members : BMI() initialize the height and weight to 1.0. void set(float, float) set the value to height and weight void calculate()- calculate the BMI where bmi = weight(kg)/(height(m)*height(m)) void display() display the weight status. The program will ask user to enter his/her weight and height to get the bmi. After the program calculate the bmi, the program will display message to user according to their weight categories. BMI Weight Status Below 18.5 Underweight 18.5 -24.9 Normal 25 - 29.9 Overweight 30 & Above Obese Sample output : This program will calculate your body mass index. Enter your height in meter (m) unit : 1.63 Enter your weight in kilogram (kg) unit : 45 Your bmi is : 16.937 You are underweight

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!