BMI

Jun 11, 2020 at 1:05pm
Write your question here.


The Body Mass Index (BMI) of a person is calculated as weight in kilograms divided by height in meters
squared (i.e BMI = weight / height2).
a. Write a C++ function named CalculateBMI that accepts two parameters (weight and height) and
returns the BMI (use the appropriate Data types). [10 marks]
b. A class have 30 students, Write a C++ Program to Capture and Store the Names of all the Students
and their respective Ages. [7 marks]
c. Your program should Display the Names and Ages of All those under 18 years as well as the Total
number of all students under 18 years. [6 marks]
d. Your Program should also load store the Names and Ages of all students 18 years and above in
another storage locations. [6 marks]
e. Your program should request the Weight in kilograms and Height in meters of each student who is 18
years and above and store them in storage locations. [6 marks]
f. Your Program should Calculate the BMI using the CalculateBMI function created in (a) above of
each of the students 18 years and above and store in a storage location. [7 marks]
g. Your Program should finally display all the Names of the Students who are 18 years above, their Age,
their, Weight, their Height, their BMI and the BMI category they belong to (Using the BMI
Categories Below) and the Total Number of Students 18 years and Above. [10 marks]
h. Draw a flowchart for the program in above. [8 marks]
BMI Categories:
BMI RANGE BMI Category
18.4 and Below Under Weight
18.5 – 24.9 Normal Weight
25.0 – 29.9 Over Weight
30.0 – 34.9 Obese
35.0 – 39.9 Severely Obese
40.0 – 49.9 Morbidly Obese
50.0 and Above Super Obese
Sample Output of the Program
Students Under 18 Years
*********************
Student Name Age
***************************************
Fred Oppon 16
Abena Quao 17
Joyce Mensah 15
… ..
… ..
… ..
Elikplim Dodoo 16
Jun 11, 2020 at 1:07pm
You didn't ask a question. If you are trying to complete an assignment, show us what you've tried so far, and what specifically you're having trouble with.
Jun 12, 2020 at 4:59pm
Hello benninbernard,

If there are any input files you will need to include them, or at least a good sample, so everyone can be using the same information.

Andy
Topic archived. No new replies allowed.