Myfile

Author: 2e4cbe8e43

02 March 2018

Views: 244

/**
* Pollution.java
*
* @author authorname
* Date: March 01, 2018
*/
public class Pollution {

/**
* Process a file whose name is passed through cmd arguments.
* display totals records processed and max pollution stats.
*
* @param args
*/
public static void main(String [] args) throws Exception {
//args = new String[1];
//args[0] = "data/kirkstall.csv";

if(args.length != 1) {
System.out.println("ERROR: no file name provided");
System.out.println("USage:");
System.out.println("java Pollution filename.csv");
return;
}

// Create data set
PollutionDataset ds = new PollutionDataset();
ds.readCSV(args[0]);

//Display number of records and statistics.
System.out.println(ds.size() + " records processed");

// Display Maximum Record
System.out.println("Max: " + ds.maxLevel());

// Display Minimum Record
System.out.println("Min: " + ds.minLevel());

// Display Mean Record for entire data set.
System.out.println("Mean: " + ds.meanLevel());

// Display Day Breached Hour for a date.
System.out.println("EU Rule - Day Breached: " +
ds.dayRulesBreached());
}
}


Edit Code:

Please enter an edit code

Edit codes must be at least 20 characters

Share