Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The weather in South Western Ontario can fluctuate dramatically, so it can be a bit of a challenge to put out information about what
The weather in South Western Ontario can fluctuate dramatically, so it can be a bit of a challenge to put out information about what is normal weather for a given time period. With that in mind, we need to write a program called WeatherAnalyzer(StudentID).java that will allow the user to enter some daily temperatures in Celsius degrees over a number of days. The program will calculate and print out the average high temperature, the average low temperature, the highest temperature for a given time period, the lowest temperature for the same time period, and the range of temperatures. Detailed Description: Your program will first explain that it will calculate and display some statistics about the temperatures you enter. The program will ask the user for the number of days they will be analyzing. Each high temperature will be stored in an array of the appropriate data type. Set the size of your array based on how many days the user will be entering temperatures. Each low temperature will also be recorded for the same time period in a separate array. After all of the temperature data has been entered, your program will call four separate methods to do the data analysis. The first method will accept the high temperature array as a parameter and it will calculate and return the average of all the temperatures in the array. You will call the method again, but this time, you will be sending in the low temperature array and will send back the average of the low temperature. The second method will take the high temperature array as a parameter and it will find the highest daily temperature in the array and return this value. The third method will take the low temperature array as a parameter and it will find the lowest daily temperature in the array and return this value. The fourth method will take in both arrays and find the difference between the lowest and highest temperatures and return this value as the range of temperatures. NOTE: all displayed values should be ROUNDED to ONE decimal place if necessary. Sample Output: Mike's Weather Analyzer Program **** Please let me know the number days we will be analyzing: 4 Please enter the high temperature for day #1: 34.5 Please enter the low temperature for day #1: 23.3 Please enter the high temperature for day #2: 33.1 Please enter the low temperature for day #2: 22.8 Please enter the high temperature for day #3: 35.6 Please enter the low temperature for day #3: 24.7 Please enter the high temperature for day #4: 27.4 Please enter the low temperature for day #4: 18.7 Here are the statistics for the 4 days entered. The average high temperature was 32.7 degrees. The average low temperature was 22.4 degrees. The low temperature was 18.7 degrees. The high temperature was 35.6 degrees. The range betweeen the high and low temperatures was 16.9 degrees.
Step by Step Solution
★★★★★
3.37 Rating (144 Votes )
There are 3 Steps involved in it
Step: 1
Certainly Below is a sample Java program named WeatherAnalyzerjava that fulfills the requirements you provided java import javautilScanner public clas...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started