import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; public class StockAnalysis { public static void main(String [] args) { StockDataBase startingvalue = new StockDataBase(0); StockDataBase endingvalue = new StockDataBase(0); try { Scanner input = new Scanner(new File("values.txt")); PrintWriter output = new PrintWriter("values.txt"); output.println("2013"); int n =0; int m =0; for(int i = 0; i<=365; i++) { n =(int)(Math.random()); m =(int)(Math.random()); output.println(DayConverter.getDateString(i, false)); startingvalue= new StockDataBase(n); endingvalue= new StockDataBase(m); output.println(startingvalue); output.println(endingvalue); } while(input.hasNext()) { String year= input.next(); } while(input.hasNextInt()) { int year = input.nextInt(); int start =input.nextInt(); int end = input.nextInt(); startingvalue= new StockDataBase(start); endingvalue= new StockDataBase(end); System.out.println("" + " " + year); System.out.println("-------------------------------"); System.out.println(startingvalue + " " + endingvalue); } input.close(); } catch (IOException e) { System.out.println("Unable to open or read from file. "); } } }