// method adds new Week object to array at specified position // should this be moved to an interface? // also, Location could be instantiated outside of this method first public void AddWeek(int weekNumber, string locationName, string locationState, double winningAmount) { // create new Week object Weeks[weekNumber] = new Week(new Location(locationName, locationState), winningAmount); // update total winnings CalculateTotalWinnings(); }
// constructor instantiates empty Weeks array public Winnings() { this.Weeks = new Week[8]; for (int x = 0; x < Weeks.Length; ++x) Weeks[x] = new Week(); }