(x) Next (still inside the while loop), use the following formula to compute the temperature of each of the 12 months of years 1, 2, 4 and 5. Use a for loop to loop over the months in a given year.

Year i = 1:

Month j = 1, 2, ... 12

Note: (A) and (B) below, taken together will be called "Equation 1".

(A) Winter Months: j = 1, 2, 11 and 12: Temperature = j + 3

(B) Other Months: j = 3, 4, 5, .., 9, 10: Temperature = 5j + 7

Note: Use a logical expression to differentiate between Winter and Other Months, in conjunction with the ?: operator, all in one single statement to compute the temperature for a month j using Equation 1.

1st year, so ANNUAL_INCREASE doesn't apply, but uncertainty does. In the next line, increase Temperature by Uncertainty percent to display the final temperature, for each month.

Example: If Temperature calculated above is 45.0, and uncertainty is 2.1 percent, then final Temperature is 45.0 * (1.0 + 2.1/100) = 45.945. Only the integer part is to be displayed (decimal part truncated), so it should show 45 as the value in this case.

Years: i = 2, 4, 5

First calculate Temperature using Equation 1. Next, find the increases to apply to that value. Temperature increase per year: ANNUAL_INCREASE (degrees) - same increase applies to each month of a year. Use the Year i and ANNUAL_INCREASE in an expression to figure the exact increase that would apply for that year.

Uncertainty percent applies to the value obtained after the ANNUAL_INCREASE.

Example: If temperature for a month is 45.0 using Equation 1, and it is Year 4, so you are 3 years away from Year 1, which means 3 annual increases on top of each other. Each annual increase is 1.0 degree (= ANNUAL_INCREASE), so for 3 years beyond Year 1, you need 1.0 + 1.0 + 1.0 = 3.0 degrees from the base value (45.0), so temp for Year 4 would be 45.0 + 3.0 = 48.0.

Next, you apply the uncertainty percent on this modified value (48.0) as applicable for year 4 (7.4 percent). So the temperature for that month in Year 4 becomes: 48.0 X (1.0 + 7.4/100) = 51.552. Value displayed will be integer part only (decimal part truncated), so it should display 51 in this example.

Inside the 'for loop', concatenate temperature values for all 12 months with spaces in between, assign it to 'result' and display in one line along with the Year i. Repeat for years 1, 2, 4 and 5. Try to align the output with the Month headers by maniupulating the blank space in between.

(xi) A sample output session is shown below (your output needs to match with this):

C:\Java\Lesson4\assign41>javac Weather.java

C:\Java\Lesson4\assign41>java Weather

Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

1 4 5 22 27 32 37 42 47 53 58 14 15

2 5 6 23 29 34 39 44 50 55 60 15 16

4 7 8 26 32 37 42 48 53 59 64 18 19

5 8 9 28 33 39 44 49 55 60 66 19 20

C:\Java\Lesson4\assign41>

I need help on these step... if any one could you please help me,.