package Lect28Debugging; public class MonthlyCalendarSimpleCorrect { private static final int NUMBER_OF_WEEKS = 6; private static final int DAYS_PER_WEEK = 7; private int numberOfDays; private int startingDayNum; // First day of month (starts at 1) private String monthName; private Day[][] calendar; public MonthlyCalendarSimpleCorrect(String theMonthName, int theNumberOfDays, int theStartingDay) { monthName = theMonthName; numberOfDays = theNumberOfDays; startingDayNum = theStartingDay; // create the two-dimensional array with Day // objects. Each week has an array with a fixed length // of days with null days when there aren't any. calendar = new Day[NUMBER_OF_WEEKS][]; int currentDayNumber = 1; int dayIndex = 0; for (int week=0; week= (startingDayNum - 1)) { calendar[week][dayOfWeek] = new Day(mapIntToDayName(dayOfWeek), currentDayNumber); currentDayNumber++; } dayIndex++; } } } public String mapIntToDayName(int value) { String[] dayNames = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; return dayNames[value]; } public void addAppointment(int theDayNumber, String description) { for (int weekNum=0; weekNum