Hello everybody I am from Commerce Background
doing some IT stuff got some problem by professors..
Can someone solve this problem thanks..
Program Specification:
“The body mass index (BMI), or Quetelet index, is a statistical measure of the weight of a person scaled according to height. The body mass index (BMI), or Quetelet index, is a statistical measure of the weight of a person scaled according to height.” (Wikipedia, 2008)
Your task is to write a small program to assist with calculating the BMI. The BMI is calculated using the following equation:
Where the weight is measured in kg and the height in meters. The BMI is split into the following subdivisions:
Underweight < 18.5
Normal range 18.5 – 25
Overweight 25 – 30
Obese > 30
Your program is going to be used to store the height and weight 5 volunteers (using an array) and then calculate the BMI of each of these volunteers. The program has been broken down into a number of tasks to assist you with your development. You should write your code so that if the number of volunteers changes in the future the changes to the code will be kept to a minimum.
For each of the tasks provided you should provide basic design information such as any data validation, calculations that need to be performed and a first level algorithm.
Task One:
Design and implement a function that takes as its arguments two values representing the height in meters and their weight in kilograms and returns the BMI.
Task Two:
Design and implement a function that fills an array (which has been passed as an argument) capable of storing the height and weight of 10 volunteers. The function should prompt the user for the weight and height of the 10 volunteers and store them in the array.
Task Three:
Design and implement a function that displays the contents of the data in the array (passed as an argument) and calculates the BMI of each of the volunteers. Your data is to be displayed appropriately in a table with the weight and height being displayed to two decimal places and BMI to one decimal place. For example:
Person Weight (kg) Height (m) BMI
1 57.6 1.56 23.7
2 89.0 1.87 25.5
3 45.2 1.32 25.9
4 100.5 1.32 57.7
Etc…
Optional extra: Indicate, in some way, the people who are overweight or obese in some way, such as:
Person Weight (kg) Height (m) BMI
1 57.6 1.56 23.7
2 89.0 1.87 25.5*
3 45.2 1.32 25.9*
4 100.5 1.32 57.7**
* overweight
** obese
Task Four:
Design and implement a function that takes uses the contents of the data in the array (once again passed as an argument) and displays at the following information:
• average weight
• average height
• average BMI
Optional extras: you can include other information in your report such as:
• lowest (or highest) BMI calculated
• the average BMI
• the median BMI
• displays all of the people and their appropriate weight range (ie underweight or obese)
• number of people within each weight range
Task Five:
Once you have each of the above tasks design and implement a menu system that can be used to test your code, such as:
1. Calculate a single BMI
2. Enter data
3. Display data
4. Display reports
5. Exit
Enter selection:
This menu, should be used so that it can be used to test all of the tasks completed above.