Question: 8-1 Please do the coding in Java! Demo: The following code is a procedural way of writing code. It prints the weekly temperature, finds the
8-1
Please do the coding in Java!

Demo: The following code is a procedural way of writing code. It prints the weekly temperature, finds the min and max, and the average as well. h; int weekly TempC 1 69, 70, 71, 68, 66, 71, 70 int i, max 0, min 0; print temperatures for C 0; i weekly Temp length i++) 1 System. out.printfC"VnThe temperature on day %d was %d 'i, i 1 weekly Templi]); System. out.printfC''An n''); find the max, min temperature for C i 7 i++) 1 if Ci 0) max min weekly Templi] if CweeklyTempli] max) max. Weekly Templi] if Weekly Temp LLJ min) min weekly Templi] System. out.printfC"The Minimum temperature is: %d n", min System. out.printfC"The Maximum temperature is: %d n", max); get average float total 0, average for C 0; i 7 i++) total weekly TempCil average total weekly Temp. Length System. out.printlnC"The average temperage for the week is: average)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
