import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the month: "); String month = input.nextLine(); System.out.print("Enter the year: "); int year = input.nextInt(); input.close(); int days; if(month.equals("April") || month.equals("June") || month.equals("September") || month.equals("November")) days = 30; else if(month.equals("February")) days = 28; else days = 31; boolean isLeapYear = false; if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) isLeapYear = true; if(isLeapYear && days == 28) days++; System.out.println(month + " " + year + " has " + days + " days"); } }