App 2 Body Mass Index Calculator - Amir94Mohamed/ConsoleApps GitHub Wiki

App02: Body Mass Index Calculator

Description

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.

Features

  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.
  7. A Mobile Phone App version of the calculator
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

Design

UML Activity Diagram

Activity Diagram

UML Class Diagram (10 Marks)

Class Diagram

Testing

Console Screen Shots (12 Marks)

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

BMI Calculator
Other Testing

Web Screen Shots (12 Marks)

BMI Chart Used

BMI Chart

Black Box OR Unit Tests (48 Marks)

[Metric]

Test Height (metres) Weight (kg) BMI
01 1 75 75 (Obese class 3 / High risk)
02 1.1 76 62.8 (Obese class 3 / High risk)
03 1.2 77 53.4 (Obese class 3 / High risk
04 1.3 78 46.1 (Obese class 3 / High risk
05 1.4 79 40.3 (Obese class 3 / High risk
06 1.5 80 35.5 (Obese class 2 / High risk
07 1.6 81 31.6 (Obese class 1 / High risk
08 1.7 82 28.3 (Overweight / High risk)
09 1.8 83 25.6 (Overweight / Increased risk)
10 1.9 84 23.2 (Normal / Increased risk)
11 2.0 85 21.2 (Normal / Increased risk)
12 2.1 86 19.5 (Normal)

[Imperial]

Test Weight & Height BMI
01 stones = 0 pounds = 2 feet = 2 inches = 2 BMI result 2.08/ you are Underweight
02 stones = 0 pounds = 8 feet = 7 inches = 3 BMI result 0.74/ you are Underweight
03 stones = 3 pounds = 5 feet = 3 inches = 2 BMI result 22.88/ you are Normal
04 stones = 3 pounds = 5 feet = 3 inches = 3 BMI result 21.72/ you are Normal
05 stones = 4 pounds = 2 feet = 3 inches = 3 BMI result 26.81/ you are Overweight
06 stones = 8 pounds = 5 feet = 4 inches = 5 BMI result 29.28 / you are Overweight
07 stones = 8 pounds = 7 feet = 4 inches = 3 BMI result 32.16/ you are Obese Class I
08 stones = 9 pounds = 8 feet = 4 inches = 7 BMI result 31.14/ you are Obese Class I
09 stones = 9 pounds = 10 feet = 4 inches = 3 BMI result 36.76/ you are Obese Class II
10 stones = 10 pounds = 11 feet = 4 inches = 5 BMI result 37.79/ you are Obese Class II
11 stones = 14 pounds = 34 feet = 3 inches = 4 BMI result 99.3/ you are Obese Class III
12 stones = 15 pounds = 16 feet = 7 inches = 3 BMI result 20.99/ you are Normal

Evaluation (20 Marks)

  1. One improvement is to ensure that the BMI gives a result. I was unable to fully code it.
  2. As an Extension I wanted that when the results are shown it would also include the BAME and the weight class
  3. Another Extension is that when starting the application it will be easier to fill in either your metric and imperial measurements.
  4. Adjust the web app version. Fix the size and the overlapping text.
  5. colour coded results. I wanted to give each BMI class a different colour to make it more aesthetically pleasing and shows user if they are healthy a green colour and if not a red or other for each class.
⚠️ **GitHub.com Fallback** ⚠️