OVERVIEW Body mass index (BMI) is a value derived from the mass (weight) and height of a person. The BMI is defined as the body mass divided by the square of the body height, and is expressed in units of kg/m², resulting from mass in kilograms and height in meters. The BMI may be determined using a table or chart which displays BMI as a function of mass and height using contour lines or colors for different BMI categories, and which may use other units of measurement (converted to metric units for the calculation). The BMI is a convenient way for classifying persons in to 4 categories based the BMI value as shown the following table:
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
![OVERVIEW
Body mass index (BMI) is a value derived from the mass (weight) and height of a person. The BMI
is defined as the body mass divided by the square of the body height, and is expressed in units of kg/m2,
resulting from mass in kilograms and height in meters. The BMI may be determined using a table or chart
which displays BMI as a function of mass and height using contour lines or colors for different BMI
categories, and which may use other units of measurement (converted to metric units for the
calculation). The BMI is a convenient way for classifying persons in to 4 categories based the BMI value
as shown the following table:
BMI value
Category
Underweight
Normal
Overweight
Less than 18.5
18.5 to less than 25
25 to less than 30
30 or higher
Obese
A national study in some country to analyze the BMI of the people in the country is considered. In this
study, a set of cities is selected in the study and randomly specific number of persons are selected to
check the BMI category of each one.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb1585e07-02ec-44f7-9cdf-227b72c0f7ba%2F2e35d367-c477-4140-9520-4e148e5810ce%2Fazdm3qi_processed.png&w=3840&q=75)
![Implement a java project to help in the study analysis with the following steps:
Read from the user the number of cities (minimum 6 cities.)
For each city: city name and the number of persons (minimum 10 persons) are entered.
• For each person in a city: mass and height should be entered, BMI and BMI category have to be
computed and printed.
For each city, the number of persons and percent ratio in each BMI category should be computed
and printed.
Finally, the program should print a summary report with the following details:
o Number of cities.
o Total number of persons and percent ratio of persons in each BMI category in all cities.
o The name of the best city which has the maximum percent of persons in normal weight
BMI category and these people's percent ratio.
o The name of the worst city which has the maximum percent of persons in obese BMI
category and these people's percent ratio.
o The name of the city which has the minimum percent of persons in underweight BMI
category and these people's percent ratio.
End of TMA,](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb1585e07-02ec-44f7-9cdf-227b72c0f7ba%2F2e35d367-c477-4140-9520-4e148e5810ce%2Fhn3n18_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)