Calendar.java code: Complete the printMonth() and firstDayOfNextMonth() methods: import java.util.Scanner; public class Calendar { static final int FEBRUARY = 2; static final int MONTHS_PER_YEAR = 12; static int [] daysPerMonth = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static String [] months = {"", " Januray", "February", " March", " April", " May", " June", " July", " August", "September", " October", "November", "December"}; public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter the year? (yyyy): "); int year = in.nextInt(); int firstDay = firstDayOfYear(year); // February: Check for leap year daysPerMonth [FEBRUARY] = isLeapYear(year) ? 29 : 28; for (int i=1; i
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |