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 and the total number of minutes of exercise they get in a typical week onto the screen. Items will be displayed, as shown below (remember to use =, where appropriate). Example output is shown below (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). The ratio message that will be displayed is dependent upon the indicated gender and waist to height ratio, as shown below.
Waist to Height Ratio 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.
This program must make use of a nested if/else statement and loops. 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 and total number of minutes of exercise in a typical week), 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 Run #1: (OUTPUT) ************************************************** ************************************************** Please enter your waist measurement, in inches:25 Please enter your height measurement, in feet and inches (separate feet and inches by a space): 5 4 Please enter your gender, F for female or 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: 30 Please enter the typical number of minutes of exercise you get on day 3 of each week: 35 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: 10 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: 40 ************************************************** ************************************************** Waist = 25 inches Height = 64 inches Gender: F Waist to Height Ratio = 39.06% You are considered underweight. Number of Minutes of Exercise in a Typical Week = 165
Sample Run #2: ************************************************** ************************************************** Please enter your waist measurement, in inches: 44 Please enter your height measurement, in feet and inches (separate feet and inches by a space): 6 4 Please enter your gender, F for female or M for male: M Please enter the typical number of minutes of exercise you get on day 1 of each week: 10 Please enter the typical number of minutes of exercise you get on day 2 of each week: 10 Please enter the typical number of minutes of exercise you get on day 3 of each week: 45 Please enter the typical number of minutes of exercise you get on day 4 of each week: 60 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 = 44 inches Height = 76 inches Gender: M Waist to Height Ratio = 57.89% You are considered overweight. Number of Minutes of Exercise in a Typical Week = 165
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
