Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Weathermen never look back at how accurate their predictions were. Let's help them. Write a class WeatherAccuracy whose constructor (two arguments, a String filename and

Weathermen never look back at how accurate their predictions were. Let's help them.

Write a class WeatherAccuracy whose constructor (two arguments, a String filename and integer number of days) reads from the file multiple days of high temperature predications (two days prior and one day prior) and actual high temperature reading (all positive integers). Each line in the input file is for the line number day of the month in the format

2DayPriorPrediction 1DayPriorPrediction Actual

75 77 78

74 74 73

75 74 72

. . .

No set* or get* are needed, the constructor will read the file and load the data into a colletion in the object. You should read the input file only once.

The following methods are needed:

  • worstPrediction - returns the day of the month with the overall worst two-day and one-day prediction compared to actual. This is measured by the sum of absolute value of how far off each prediction was for that day. c
  • mostCommonActualTemp - returns the actual temperature that occurs most often in the input fileimage text in transcribedimage text in transcribed
weatherl.txt weather2.txt Weather Accuracy.java + New 1 Exit Full Screen 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 weatherl.txt weather2.txt Weather Accuracy.java + New Exit Full Screen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 75 77 78 74 74 73 75 74 72 69 66 64 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68 75 77 78 74 74 73 75 74 72 69 66 62 65 64 64 70 72 68

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

Step: 3

blur-text-image

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

Students also viewed these Databases questions

Question

Explain four types of complexity in the scientific approach.

Answered: 1 week ago