1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the month: "); 10 String month = input.nextLine(); 11 System.out.print("Enter the year: "); 12 int year = input.nextInt(); 13 14 input.close(); 15 16 int days; 17 18 if(month.equals("April") || month.equals("June") || month.equals("September") || month.equals("November")) 19 days = 30; 20 else if(month.equals("February")) 21 days = 28; 22 else 23 days = 31; 24 25 boolean isLeapYear = false; 26 if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) 27 isLeapYear = true; 28 29 if(isLeapYear && days == 28) 30 days++; 31 32 System.out.println(month + " " + year + " has " + days + " days"); 33 } 34 }