Question: Please do it fast as soon as possible, I need to prepare these type of exercises for my test till 4:30 today, please help me

Please do it fast as soon as possible, I need to prepare these type of exercises for my test till 4:30 today, please help me

IINPORTANT: Use JAVA

Chapter5 Method (7th edition)

Write a program that asks for the users height (in inches), weight (in pounds) , and age (in years), and then computes clothing sizes according to the following formulas: Use type double for all variables to simplify the calculations. However, display clothing sizes as integer values (use Math.ceil() to get some more realistic results).

The formulas: 1. Hat size (in inches) = Weight / height * 2.9 2. Jacket size (chest size in inches) = Height * Weight / 288. This value is adjusted by adding 1/8th of an inch for each 10 years over 30. (Note that the adjustment only takes place after a full 10 years. So, there is no adjustment for ages 30 through 39, but 1/8th (0.125) of an inch is added for age 40).

Note: 1/8 is zero in Java (use 0.125 or 1.0/8 instead). 3. Waist (in inches) = Weight / 5.7 and then adjusted by adding 1/10th of an inch for every 2 years over 28. The adjustment only takes place after a full 2 years. So, there is no adjustment for age 29, but 1/10th (0.1 or 1.0/10) of an inch is added for age 30. Another 0.1 of an inch is added at age 32 but nothing is added at 31, or 33, etc. You can use the / (integer division) operator to determine the 10 year increments or the 2 year increments. I.e., if someone is 88, then they are 88-30 = 55 years over 30. Therefore, we add 5 * 1.0/8 to the desired jacket size. The 5 year increments is obtained using: 55 / 10 which is = 5 in Java.

NOTES 1. Each input value must be reasonable and cannot be negative (e.g., height <= 84 in, age <= 120 years and weight <= 1000 lbs). 2. Use loops to force the user to re-enter the value as the case may be. For example: age must be between 1 and 120 inclusive, height between 1 and 84, and weight between 10 and 1000.

3. Use a separate method for each calculation and a separate method for the output. 4. Use Math.ceil() to round the output to the next integer value before printing it. I.e., if the calculated hat size is 3.2, you should print the hat size as 4 and not 3.2. The output must have a header as in the sample runs below. 5. Your program should allow the user to repeat the calculations as often as they want. You should know how to do this.

Sample Run 1

This program uses your weight, height and age to calculate clothing sizes. Enter your weight in pounds: 150

Enter your height in inches: 78

Enter your age in years: 48

Your Clothing sizes in inches are:

Hat size Jacket size Waist

6 41 28

Would you like to do another calculation? : y

Sample Run 2 This program uses your weight, height and age to calculate clothing sizes.

Enter your weight in pounds: 220

Enter your height in inches: 78

Enter your age in years: 18

Your Clothing sizes in inches are:

Hat size Jacket size Waist

9 60 39

Would you like to do another calculation? : n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!