Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I just need the answer to the second part of the question which is the modify your program. 1. Write a C program that calculates

image text in transcribedimage text in transcribed

I just need the answer to the second part of the question which is the modify your program.

1. Write a C program that calculates the user's body mass index (BMI) and categorizes it as underweight, normal, overweight, or obese, based on the flowing table from the U.S. Centers for Disease Control and Prevention: BMI Below 18.5 18.5-24.9 25.0-29.9 30.0 and above Weight Status Underweight Normal Overweight Obese Use the following formula to compute BMI (where w is weight in pounds and h is height in inches): 703 x w BMI h2 Your program should prompt the user and then input the weight in pounds and the height in inches. If your calculation determines that the person is overweight or obese, prompt the user and then input the amount of weight they would like to lose per week (in the range of 0.5 - 2 lbs. per week) and then print how many weeks it would take before their weight is in the normal range. If they input any illegal values for any inputs just print an error mes- sage and do nothing. You can exit the program using 'return 1'. 2. Modify your program to prompt the user and input a integer height and two integer weights (w], w2) and then print out their height (as feet and inches) plus a table showing the BMI values every 1/2 pound for every weight between wi and w2 (inclusive). Format your tables nicely so everything lines up properly. Floating point output should be rounded off to 2 digits after the decimal point. (continued on next page) To accomplish this you will need to use a while loop. Here is an example loop to output all the values between 1 and 10 inclusive: int i = 1; while(i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions