Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions