Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BMI or Body Mass Index is a health parameter that can be calculated using the following formula. BMI=Weight703Height a) Write a function called bmiCalc that

BMI or Body Mass Index is a health parameter that can be calculated using the following formula.

image text in transcribedBMI=Weight703Height

a) Write a function called bmiCalc that takes two parameters weight (pound) and height (inches) and returns BMI.

b) Write a function called min that takes an array of floating-point numbers and and size of the array and returns the minimum value of the members of the array.

c) Use these functions in a program that determines and prints the minimum of BMIs of 5 patients before and after a 4-week diet.

The program should ask user to enter the weights and the heights of the patients before and after the diet.

These data should be stored in two arrays called weight, and height.

Then the calculated BMI of the patients should be stored in two arrays called beforeDietBMI and afterDietBMI.

The minimum of the arrays beforeDietBMI and afterDietBMI should be calculated using function min and printed.

If the minimum BMI of the patients after the diet shows a minimum 15% reduction, then the program should show the message " The diet has been effective to reduce the minimum BMI.", Otherwise it should print " There is no significant change in BMI".

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

More Books

Students also viewed these Databases questions