Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I just the answer to the second part, but your welcome to answer both . Please answer in C 1. Write a C program that

I just the answer to the second part, but your welcome to answer both . Please answer in Cimage text in transcribed

image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions