Question: Create a Java program that will evaluate a persons health. The program will ask the user for their waist measurement (in inches), height measurement (in
Create a Java program that will evaluate a persons health. The program will ask the user for their waist measurement (in inches), height measurement (in feet and inches), gender and number of minutes of exercise they get in a typical week. After evaluating, the program will print the users waist measurement (in inches), height measurement (in inches), gender, waist to height ratio (as a percentage, rounded to 2 decimal places), a ratio message, the total number of minutes of exercise they get in a typical week and an exercise message onto the screen. Items will be displayed, as shown below (remember to use =, where appropriate). Example output is shown below in red (note: the output shown below is an example, your values will be different). Before asking for the users waist measurement and, again, before printing the users measurements, you will print 2 lines containing 50 asterisks per line (you must use a nested for loop to complete this task).
After printing one users waist to height ratio, the program will ask if they would like to calculate another waist to height ratio (this will continue, as long as the user indicates that they would like to perform another calculation). The ratio message that will be displayed is dependent upon the indicated gender and waist to height ratio, as shown below.
| GENDER | WAIST TO HEIGHT RATIO | RATIO MESSAGE |
| Female | Under 42% | You are considered underweight. |
| 42% to 48% | You are at a healthy weight! | |
| 48.01% to 57% | You are considered overweight. | |
| Over 57% | You are considered obese. | |
| Male | Under 43% | You are considered underweight. |
| 43% to 52% | You are at a healthy weight! | |
| 52.01% to 62% | You are considered overweight. | |
| Over 62% | You are considered obese. |
The exercise message that will be displayed is dependent upon the number of minutes of exercise that the user gets in a typical week. If the user gets under 150 minutes, print the message You are not getting a sufficient amount of exercise in a typical week. Otherwise, print the message You are getting adequate exercise in a typical week. This program must make use of a nested if/else statement, a while or dowhile loop and a switch statement. This program will make use of 7 methods. The first method will be used to print the lines of asterisks onto the screen. The second method will be used to ask for the waist measurement (in inches). The third method will be used to ask for the height measurement (in feet and inches) and convert this height to total inches (remember, a method can return only a single value). The fourth method will be used to ask for the users gender. The fifth method will be used to ask for the typical number of minutes of exercise the user gets each day of the week; this method will perform a cumulative algorithm to calculate the total number of minutes of exercise that the user gets in a typical week. The sixth method will be used to calculate the waist to height ratio. The seventh method will be used to print the users information (i.e., waist measurement, height measurement, gender, waist to height ratio, ratio message, total number of minutes of exercise in a typical week and exercise message), as described above. Several of these methods will make use of parameters. At least 3 of these methods will return a value. Program output should appear exactly as shown below. User input is bold.
(Sample):
**************************************************
**************************************************
Please enter your waist measurement, in inches: 32
Please enter you height measurement, in feet and inches (seperate feet and inches by a space): 5 10
Please enter your gender, F for female M for male: M
Please enter the typical number of minutes of exercise you get on day 1 of each week: 40
Please enter the typical number of minutes of exercise you get on day 2 of each week: 45
Please enter the typical number of minutes of exercise you get on day 3 of each week: 20
Please enter the typical number of minutes of exercise you get on day 4 of each week: 10
Please enter the typical number of minutes of exercise you get on day 5 of each week: 40
Please enter the typical number of minutes of exercise you get on day 6 of each week: 25
Please enter the typical number of minutes of exercise you get on day 7 of each week: 0
**************************************************
**************************************************
Waist = 32 inches Height = 70 inches
Gender: M Waist to Height Ratio = 45.71%
You are at a healthy weight! Number of Minutes of Exercise in a Typlical Week = 180
You are getting adequate exercise in a typical week.
Would you like to perform health calculations for another user (enter Y or N)? Y
************************************************** **************************************************
Please enter your waist measurement, in inches: 40
Please enter you height measurement, in feet and inches (seperate feet and inches by a space): 5 11
Please enter your gender, F for female M for male: F
Please enter the typical number of minutes of exercise you get on day 1 of each week: 25
Please enter the typical number of minutes of exercise you get on day 2 of each week: 55
Please enter the typical number of minutes of exercise you get on day 3 of each week: 10
Please enter the typical number of minutes of exercise you get on day 4 of each week: 0
Please enter the typical number of minutes of exercise you get on day 5 of each week: 15
Please enter the typical number of minutes of exercise you get on day 6 of each week: 25
Please enter the typical number of minutes of exercise you get on day 7 of each week: 0
**************************************************
**************************************************
Waist = 40 inches Height = 71 inches
Gender: f Waist to Height Ratio = 56.34%
You are considered overweight. Number of Minutes of Exercise in a Typlical Week = 130
You are not getting a sufficient amount of exercise in a typical week.
Would you like to perform health calculations for another user (enter Y or N)? N
Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
