To check how climate is changing, students are processing records of day-by-day temperatures measured at different locations. Let us assume that the temperatures recorded at each location are placed...


To check how climate is changing, students are processing records of day-by-day temperatures measured at different locations.


Let us assume that the temperatures recorded at each location are placed in a separate file, with the name of specific location and each day's temperature on a separate line. Your program should read the name of the file from the command line. It will then read the data from the file line by line,put the data into an array,print the name of the location, and compute and print the following information using separatemethods:



  • the average temperature at this location,

  • the warmest temperature at this location,

  • the coldest temperature at this location, and

  • the average temperature if we exclude the two extremes.


After printing, the information about one location, the program should check if there are more locations to process (if they exist in file), and process them if needed (if user wants to see this information)


Example.Assume that the sensors at the El Paso International Airport location recorded the temperatures 70, 65, 61, 71, and 66, in Tallinn – 60, 57, 50, 51, 56, in London – 65, 67, 50, 51, 56. In this case, the input file is as follows:


El Paso International Airport70 65 61 71 66


Tallinn48 52 50 51 56


London65 67 50 51 56



In this example (El Paso International Airport), the average temperature is



70 + 65 + 61 + 71 + 66 333


--------------------------- = ------ = 66.6,



5 5


the warmest temperature is 71, the coldest temperature is 61, and if we exclude the extreme values 61 and 71, then the average of the remaining temperatures is



70 + 65 + 66


----------------- = 67.0.



3

Dec 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here