Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Stats
- {
- int sum = 0;
- int mean = 0;
- double median = 0.0;
- double deviation = 0.0;
- static public ArrayList<Double> callStats()
- {
- String statFile = "Saved_Draws.txt";:
- ArrayList<Double> savedStats = new ArrayList<Double>();
- try
- {
- FileReader dataReader = new FileReader(statFile);
- BufferedReader savedFile = new BufferedReader(dataReader);
- String statsPerLine = savedFile.readLine();
- while (statsPerLine != null)
- {
- savedStats.add(Double.parseDouble(statsPerLine));
- statsPerLine = savedFile.readLine();
- }
- return savedStats;
- } catch (FileNotFoundException exp)
- {
- exp.printStackTrace();
- return null;
- } catch (IOException exp)
- {
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment