import java.io.*; public class Days { public static void main (String[] args) throws IOException { InputStreamReader reader = new InputStreamReader (System.in); BufferedReader input = new BufferedReader (reader); System.out.print ("Enter the month: "); String month = input.readLine (); month = month.toUpperCase (); int month_number = 0; if (month.startsWith ("JAN")) month_number = 1; else if (month.startsWith ("FEB")) month_number = 2; else if (month.startsWith ("MAR")) month_number = 3; else if (month.startsWith ("APR")) month_number = 4; else if (month.startsWith ("MAY")) month_number = 5; else if (month.startsWith ("JUN")) month_number = 6; else if (month.startsWith ("JUL")) month_number = 7; else if (month.startsWith ("AUG")) month_number = 8; else if (month.startsWith ("SEP")) month_number = 9; else if (month.startsWith ("OCT")) month_number = 10; else if (month.startsWith ("NOV")) month_number = 11; else if (month.startsWith ("DEC")) month_number = 12; int days = 0; switch (month_number) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: days = 31; break; case 4: case 6: case 9: case 11: days = 30; break; case 2: days = 28; break; } System.out.println (month + " is month number " + month_number + "\n" + "It has " + days + " days."); } }