//================================ //DayObject //================================ public class DayObject { public int dy; public int[] DayCatAvgs; public int[] DaySingleAvgs; //Constructors public DayObject() { } public DayObject(int theDay) { this.dy = theDay; DayCatAvgs = new int[100]; DaySingleAvgs = new int[10]; for (int i = 0; i < 100; i++) { DayCatAvgs[i] = 0; } for (int i = 0; i < 10; i++) { DaySingleAvgs[i] = 0; } } } //================================ //MonthObject //================================ public class MonthObject { public int mo; public int[] MonthCatAvgs; public int[] MonthSingleAvgs; public DayObject[] DayObjs; //Constructors public MonthObject() { } public MonthObject(int theMonth) { this.mo = theMonth; MonthCatAvgs = new int[100]; MonthSingleAvgs = new int[10]; for (int i = 0; i < 100; i++) { MonthCatAvgs[i] = 0; } for (int i = 0; i < 10; i++) { MonthSingleAvgs[i] = 0; } if(theMonth == 2) { DayObjs = new DayObject[29]; } else if(theMonth == 4 || theMonth == 6 || theMonth == 9 || theMonth == 11) { DayObjs = new DayObject[30]; } else { DayObjs = new DayObject[31]; } for (int j = 0; j < DayObjs.length; j++){ DayObjs[j] = new DayObject(j + 1); } } } //================================ //YearObject //================================ public class YearObject { public int yr; public int[] YearCatAvgs; public int[] YearSingleAvgs; public MonthObject[] MonthObjs; //Constructors public YearObject() { } public YearObject(int theYear) { this.yr = theYear; YearCatAvgs = new int[100]; YearSingleAvgs = new int[10]; for (int i = 0; i < 100; i++) { YearCatAvgs[i] = 0; } for (int i = 0; i < 10; i++) { YearSingleAvgs[i] = 0; } MonthObjs = new MonthObject[12]; for(int j = 0; j < 12; j++){ MonthObjs[j] = new MonthObject(j + 1); } } }