Question

Write a modular program that calculates and displays a person’s body mass index (BMI). The BMI...

Write a modular program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula

BMI = weight * 703/height2

Where weight is measured in pounds and height is measured in inches. The program should ask the user to enter his or her weight and height and then display the user’s BMI. The program should also display a message indicating whether the person has optimal weight, is underweight, or is overweight. A person’s weight is considered optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is underweight. If the BMI value is greater than 25, then the person isoverweight.

How would a Flowchart look for this?

Homework Answers

Answer #1

#include <iostream>

using namespace std;

int main() {

double weight,height,bmi;

cout<<"Enter weight(in pounds) and height(in inches): ";

cin>>weight>>height;

//calculate bmi

bmi=weight*(703/(height*height));

if(bmi>=18.5 && bmi<25)

cout<<"Optimal Weight"<<endl;

else if(bmi<18.5)

cout<<"Underweight"<<endl;

else

cout<<"Overweight"<<endl;

}

Output

Flowchart

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The body mass index (BMI) of a person is the person’s weight divided by the square...
The body mass index (BMI) of a person is the person’s weight divided by the square of his or her height. It is an indirect measure of the person’s body fat and an indicator of obesity. Results from surveys conducted by the Centers for Disease Control and Prevention (CDC) showed that the estimated mean BMI for US adults increased from 25.0 in the 1960–1962 period to 28.1 in the 1999–2002 period. [Source: Ogden, C., et al. (2004). Mean body weight,...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...