App 02 - AtishAppadu/C-console-apps- Wiki

App02: Body Mass Index Calculator


Your BMI, or Body Mass Index, is a measure of your weight compared to your height. Accurate assessments of obesity are important, as being overweight or obese significantly increases your risk of a variety of medical conditions including type 2 diabetes, heart disease and cancer.

For most adults, BMI gives a good estimate of your weight-related health risks. If your BMI is over 35, your weight is definitely putting your health at risk, regardless of the factors below. However, there are some situations where BMI may underestimate or overestimate these risks in the 25-35 BMI range. The main ones are:

  1. Children
  2. Pregnant women.
  3. Muscle Builders
  4. BAME: Black, Asian and other minority ethnic groups.


  1. Output a heading and a introduction explaining the application
  2. Allow the use a choice of imperial (weight in stones and pounds, height in feet and inches) or metric units (weight in Kg, and height in metres)
  3. Prompts the use to enter their weight and height.
  4. Calculates and displays their BMI value.
    • BMI = (weight in kg) / (height in metres)2
    • BMI = (weight in pounds) x 703 / (height in inches)2
  5. Outputs the WHO (World Health Organisation) weight status as illustrated below
  6. Displays a message explaining to BAME groups their extra risks.
WHO Weight Status BMI kg/m2
Underweight < 18.50
Normal 18.5 - 24.9
Overweight 25.0 - 29.9
Obese Class I 30.0 - 34.9
Obese Class II 35.0 - 39.9
Obese Class III >= 40.0


UML Activity Diagram

Activity Diagram

UML Class Diagram (10 Marks)

The student should add a full class diagram here Class Diagram Screenshot


Example Screen Shot (24 Marks)

*The student should add one or more example screen shot(s) here which shows the application from start to finish


Metric screenshot


Imperial screenshot

  1. Starting the Application
  2. Inputting values
  3. Outputting results
  4. Displaying a message to BAME groups*

BMI Chart Used

BMI Chart

Black Box OR Unit Tests (48 Marks)

The student should either create a table of Black Box tests which tests the lowest and highest values for each health category and for each unit system (Metric and Imperial) (24 tests) OR should create 24 Unit tests
Alternatively one unit system could be tested using Black Box tests and the other using Unit Tests. This must be shared if working as pair programmers


Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Metric - Underweight 157CM 45KG 18 18 ok
02 Metric - Underweight 193CM 68KG 18 18 ok
03 Metric - Healthy 152CM 45KG 19 19 ok
04 Metric - Healthy 193CM 90KG 24 24 ok
05 Metric - Overweight 152CM 59KG 25 25 ok
06 Metric - Overweight 193Cm 97KG 26 26 ok
07 Metric - Obese 152CM 70KG 30 30 ok
08 Metric - Obese 180CM 97KG 30 30 ok
09 Metric - Extremely Obese 152CM 93KG 40 40 ok
10 Metric - Extremely Obese 154CM 97KG 40 40 ok


Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Imperial - Underweight 45KG 153CM 18 18 ok
02 Imperial - Underweight 68KG 193CM 18 18 ok
03 Imperial - Healthy 45KG 152CM 19 19 ok
04 Imperial - Healthy 90KG 193CM 24 24 ok
05 Imperial - Overweight 59KG 152CM 25 25 ok
06 Imperial - Overweight 97KG 193CM 26 26 ok
07 Imperial - Obese 70Kg 152CM 30 30 ok
08 Imperial - Obese 97KG 180Cm 30 30 ok
09 Imperial - Extremely Obese 93KG 152CM 40 40 ok
10 Imperial - Extremely Obese 97KG 152CM 40 40 ok

Evaluation (20 Marks)

The student should add five limitations or useful extensions that could be added to the application

  1. Gender option could be added into the program.
  2. Age option to be added into the program.
  3. Reset function can be added to the program.
  4. A Thank you message when the user inputted their data to make more user friendly.
  5. Depending on the BMI output a Friendly Message can be added to remind to user to eat healthier or exercise just a wellbeing message.