Question
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 file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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