Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity. You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs BELLOW ARE THE EXPECTED OUTPUTS Test 1: TEST 01 --- Input --- male 82 1.82 45 --- Program output --- --- Expected output (text)--- Candidate Selected! The number of males is now 7. Test 2: TEST 02 --- Input --- male 105 1.9 59 --- Program output --- --- Expected output (text)--- Candidate Overweight. Recommend more training. Test 3: TEST 03 --- Input --- female 60 1.6 66 --- Program output --- --- Expected output (text)--- Candidate Selected! The number of females is now 2. Test 4: TEST 04 --- Input --- male 150 2 59 --- Program output --- --- Expected output (text)--- Candidate Obese. Reject! Test 5: TEST 05 --- Input --- mmmmmm 82 1.82 59 --- Program output --- --- Expected output (text)--- Invalid Gender Test 6: TEST 06 --- Input --- female 62 1.85 38 --- Program output --- --- Expected output (text)--- Candidate Underweight, Recommend balanced diet and training. Test 7: TEST 07 --- Input --- male 72 1.72 99 --- Program output --- --- Expected output (text)--- Candidate Too slow. Recommend more training. Test 8: TEST 08 --- Input --- female 75 1.732 66 --- Program output --- --- Expected output (text)--- Candidate Overweight. Recommend more training. Test 9: TEST 09 --- Input --- male -150 2 59 --- Program output --- --- Expected output (text)--- Invalid weight Test 10: TEST 10 --- Input --- female 82 -1.82 59 --- Program output --- --- Expected output (text)--- Invalid height
Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.
You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs
BELLOW ARE THE EXPECTED OUTPUTS
Test 1: TEST 01
--- Input ---
male 82 1.82 45
--- Program output ---
--- Expected output (text)---
Candidate Selected! The number of males is now 7.
Test 2: TEST 02
--- Input ---
male 105 1.9 59
--- Program output ---
--- Expected output (text)---
Candidate Overweight. Recommend more training.
Test 3: TEST 03
--- Input ---
female 60 1.6 66
--- Program output ---
--- Expected output (text)---
Candidate Selected! The number of females is now 2.
Test 4: TEST 04
--- Input ---
male 150 2 59
--- Program output ---
--- Expected output (text)---
Candidate Obese. Reject!
Test 5: TEST 05
--- Input ---
mmmmmm 82 1.82 59
--- Program output ---
--- Expected output (text)---
Invalid Gender
Test 6: TEST 06
--- Input ---
female 62 1.85 38
--- Program output ---
--- Expected output (text)---
Candidate Underweight, Recommend balanced diet and training.
Test 7: TEST 07
--- Input ---
male 72 1.72 99
--- Program output ---
--- Expected output (text)---
Candidate Too slow. Recommend more training.
Test 8: TEST 08
--- Input ---
female 75 1.732 66
--- Program output ---
--- Expected output (text)---
Candidate Overweight. Recommend more training.
Test 9: TEST 09
--- Input ---
male -150 2 59
--- Program output ---
--- Expected output (text)---
Invalid weight
Test 10: TEST 10
--- Input ---
female 82 -1.82 59
--- Program output ---
--- Expected output (text)---
Invalid height
Step by step
Solved in 5 steps with 4 images