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
* This constructor:
*
* Notes:
*
* Notes:
*
*
*
* @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).
*
*
*/
private void computeRainStats(){
rainMin = Double.MAX_VALUE;
rainMax = Double.MIN_VALUE;
// TODO: complete implementation
}
/**
* Compute and fill in the temperature-related statistics:
*
*
*
*
*/
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;
}
}