Problem

(Health application: BMI) Revise Listing, ComputeAndlnterpretBMI.cpp, tolet the user enter...

(Health application: BMI) Revise Listing, ComputeAndlnterpretBMI.cpp, to

let the user enter weight, feet, and inches. For example, if a person is 5 feet, 10 inches, you will enter 5 for feet and 10 for inches. Here is a sample run:

Listing ComputeAndlnterpreteBMI.cpp

1	 #include 2	 using namespace std;34	 int main()5	{6	 //	Prompt	the	user	to	enter	weight	in	pounds7  cout << "Enter weight in pounds: " ;8  double weight;9  cin >> weight;  input weight10 11  // Prompt the user to enter height in inches12  cout << "Enter height in inches: " ; 13  double height;14  cin >> height;  input height1516  const double KILOGRAMS_PER_POUND = 0.45359237 ; // Constant17  const double METERS_PER_INCH = 0.0254 ; // Constant1819  // Compute BMI20  double weightlnKilograms = weight * KILOGRAMS_PER_POUND; 21  double heightInMeters = height * METERS_PER_INCH;22  double bmi = weightInKilograms /  compute bmi23  (heightInMeters * heightInMeters); 2425  // Display result26  cout << "BMI is " << bmi << ⌉;  display output27  if (bmi < 18.5)28  cout << "Underweight" << ⌉;29  else if (bmi < 25)30  cout << "Normal" << ⌉;31  else if (bmi < 30)32  cout << "Overweight" << ⌉;33  else 34  cout << "Obese" << ⌉;3536  return 0 ;37 }

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT