Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming C undefined One measurement of a person's fitness is their Body Mass Index. The United States Center for Disease Control uses this to classify

Programming C

image text in transcribedundefined

One measurement of a person's fitness is their Body Mass Index. The United States Center for Disease Control uses this to classify people as normal, underweight, overweight or obese, according to the following table: Less than 18.5 = Underweight 18.5 - less than 25 = Normal 25.0 - less than 30 = Overweight 30.0 and above = Obese The formula that is used to calculate BMI is 703 X wt_in_lbs / ht_in_inches? You are to write a program which includes a single function, bmi, that takes as arguments a person's weight in pounds and height in inches (both doubles) and returns a bmi_index calculated with the abov formula. Your main will then 1) ask the person for their weight and height, 2) call the function, and 3) based on the result, tell the person how they are classified. You will be doing this through a series of nested if/els statements. (Note: You may call the function once and store the result, or you may call your function as part of the condition inside the parenthesis of your if statement.) When you have the program written and compiled, test it with your own height and weight, and with some made-up heights and weights. Ideally you should test each path through the program. (i.e. for someone underweight, for someone normal, for someone overweight and for someone obese.) When you are happy with its performance start a script file healthresult.txt and run the program with the different numbers

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

Students also viewed these Databases questions