import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; /** * * @author CS2334. Modified by: ????? *
* Date: 2015-09-10
* Project 1
*
* This class represents the data for a set of months
*
*/
public class DataSet {
/** Monthly data: one entry for each month. */
private ArrayList
* Specific steps:
*
*
*
* @param fileNames Array of strings, each of which encodes the file name for a single month
*
* @throws IOException
* @throws NumberFormatException
* @throws FileNotFoundException
*/
public DataSet(String[] fileNames) throws IOException, NumberFormatException, FileNotFoundException{
// TODO: complete implementation
}
/**
* Compute the rain-related statistics given that all of the months have
* been loaded. Specifically: rainAverage, rainMin, rainMinMonth, rainMax, and
* rainMaxMonth;
*/
private void computeRainStats(){
// TODO: complete implementation
}
/**
* Compute the temperature-related statistics assuming that all of the months
* have already been loaded. Specifically: temperatureAverage, temperatureMin,
* temperatureMinMonth, temperatureMax, and temperatureMaxMonth
*/
private void computeTemperatureStats(){
// TODO: complete implementation
}
/**
* Describe the data set
*
* @return String that describes the summary statistics for the DataSet
*/
public String toString(){
String out = "";
out += "Rain Average: " + rainAverage + "\n";
out += "Rain Min: " + rainMin + " in " + rainMinMonth.getMonth() + "/" + rainMinMonth.getYear() + "\n";
out += "Rain Max: " + rainMax + " in " + rainMaxMonth.getMonth() + "/" + rainMaxMonth.getYear() + "\n";
out += "Temperature Average: " + temperatureAverage + "\n";
out += "Temperature Min: " + temperatureMin + " in " + temperatureMinMonth.getMonth() + "/" + temperatureMinMonth.getYear() + "\n";
out += "Temperature Max: " + temperatureMax + " in " + temperatureMaxMonth.getMonth() + "/" + temperatureMaxMonth.getYear() + "\n";
return out;
}
// TODO: add getters
}