import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; /** * * @author CS2334. Modified by: ????? *

* Date: 2015-09-10
* Project 1 *

* This class represents the data for all of the days within a single month * */ public class MonthlyData { /** The set of days. */ private ArrayList days; /** Minimum temperature across all days. */ double temperatureMin; /** Maximum temperature across all days. */ double temperatureMax; /** Average temperature across the days. */ double temperatureAverage; /** Minimum rainfall across all days. */ double rainMin; /** Maximum rainfall across the days. */ double rainMax; /** Average rainfall. */ double rainAverage; /** The year corresponding to this month. */ int year; /** The month. */ int month; /** * MonthlyData constructor *

* This constructor: *

* * @param fileName The name of a file that contains the data for a month. For * this project, it will be of the form "data/YYYY.csv" * * @throws IOException * @throws NumberFormatException * @throws FileNotFoundException */ public MonthlyData(String fileName) throws IOException, NumberFormatException, FileNotFoundException{ // TODO: complete implementation computeRainStats(); computeTemperatureStats(); } /** * Compute and fill in the rain-related statistics (rainMin, rainMax and rainAverage). *

* Notes: *

*/ private void computeRainStats(){ rainMin = Double.MAX_VALUE; rainMax = Double.MIN_VALUE; // TODO: complete implementation } /** * Compute and fill in the temperature-related statistics: * *

* Notes: *

*/ private void computeTemperatureStats(){ // TODO: complete implementation } // TODO: add getters /** * Describe the month * * @return A string describing all of the days and the statistics for the month */ public String toString(){ String out = ""; for(DailyData d: days){ out += d.toString() + "\n"; } // TODO: add month-level statistics to the string return out; } }