Write a Java program that performs these operations Prompt t
Write a Java program that performs these operations:
Prompt the user to enter a low height in feet (an integer).
Prompt the user to enter a high height in feet (an integer).
Prompt the user to enter a low weight in pounds (an integer).
Prompt the user to enter a high weight in pounds (an integer).
Print a table of Body Mass Index (BMI) for the heights and weights entered, ranging from the low height to the high height (inclusive), at increments of 3 inches, and for each height, from the low weight to the high weight (inclusive), in increments of 10 pounds.
Each row of the table lists the height in feet and inches (two integers separated by a space), followed by 4 spaces, followed by the weight (an integer), followed by 9 spaces, then the BMI to four decimal places (a float), followed by 9 spaces, then whether the user is overweight (BMI > 25), or not overweight (BMI < 25).
A sample run (your output should be as close to this as possible, or points will be deducted):
libra% java NestedBMI
Enter low height in feet: 5
Enter high height in feet: 7
Enter the low weight in pounds: 140
Enter the high weight in pounds: 160
Height Weight BMI
5 0 140 27.3389 overweight
5 0 150 29.2917 overweight
5 0 160 31.2444 overweight
5 3 140 24.7972 not overweight
5 3 150 26.5684 overweight
5 3 160 28.3396 overweight
5 6 140 22.5941 not overweight
5 6 150 24.2080 not overweight
5 6 160 25.8219 overweight
5 9 140 20.6721 not overweight
5 9 150 22.1487 not overweight
5 9 160 23.6253 not overweight
6 0 140 18.9853 not overweight
6 0 150 20.3414 not overweight
6 0 160 21.6975 not overweight
6 3 140 17.4969 not overweight
6 3 150 18.7467 not overweight
6 3 160 19.9964 not overweight
6 6 140 16.1769 not overweight
6 6 150 17.3323 not overweight
6 6 160 18.4878 not overweight
6 9 140 15.0008 not overweight
6 9 150 16.0722 not overweight
6 9 160 17.1437 not overweight
7 0 140 13.9484 not overweight
7 0 150 14.9447 not overweight
7 0 160 15.9410 not overweight
libra%
Solution
Please find the required program along with its output. Please see the comments against each line to understand the step.
------------------------------------------------------
OUTPUT:
Enter low height in feet:
 5
 Enter high height in feet:
 7
 Enter low weight in pounds:
 140
 Enter high weight in pounds:
 160
 Height Weight BMI   
 5 0 140 27 overweight
 5 0 150 29 overweight
 5 0 160 31 overweight
5 3 140 24 not overweight
 5 3 150 26 overweight
 5 3 160 28 overweight
5 6 140 22 not overweight
 5 6 150 24 not overweight
 5 6 160 25 not overweight
5 9 140 20 not overweight
 5 9 150 22 not overweight
 5 9 160 23 not overweight
6 0 140 18 not overweight
 6 0 150 20 not overweight
 6 0 160 21 not overweight
6 3 140 17 not overweight
 6 3 150 18 not overweight
 6 3 160 19 not overweight
6 6 140 16 not overweight
 6 6 150 17 not overweight
 6 6 160 18 not overweight
6 9 140 15 not overweight
 6 9 150 16 not overweight
 6 9 160 17 not overweight
7 0 140 13 not overweight
 7 0 150 14 not overweight
 7 0 160 15 not overweight



