Question: WeatherStation ( identifier ) This constructor initializes the internal data for the weather station. The identifier that is provided is the Station ID for this

WeatherStation(identifier) This constructor initializes the internal data for the weather station. The identifier that is provided is the Station ID for this weather station (i.e., a unique name). Initially, the weather station does not know about any daily summary reports (i.e., all counts and totals are zero).
String getId() Returns the weather station ID for this weather station.
recordDailyRain(month, rainfall) Record the information from one daily summary line in a data file, which adds the rainfall (a double) to the month (an integer from 1-12 indicating the month of the daily report).
int getCountForMonth(month) Returns the number of daily rainfall values that have been recorded for the specified month (a number 1-12). Return zero when no values have been recorded for the specified month.
double getAvgForMonth(month) Returns the average daily rainfall for the specified month (a number 1-12). This is the total rainfall across all reported daily values for that month, divided by the number of daily values that have been recorded for that month. Return -1 if no rainfall amounts have been recorded for the specified month.
int getLowestMonth() Returns the number of the month (a number 1-12) indicating the month that had the lowest average rainfall recorded at this station. If multiple months have the same lowest rainfall average, return the earliest one (the lowest month number). If no rainfall records have been entered for any month, return the earliest month as well (1).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!