class Season
{
public static void main ( String args[] )
{
int a = Integer.parseInt ( args[0] );
String s[] = {"Autumn","Summer","Pre-Monsoon","Post-Monsoon","Spring","Winter"};
String m[] = {"January","February","March","April","May","June","July","August","September","October","November","December"};
switch ( a )
{
case 1 : System.out.println("\n\nMonth : " + m[0] );
System.out.println("\n\nSeason : " + s[5] + "\n");
break;
case 2 : System.out.println("\n\nMonth : " + m[1] );
System.out.println("\n\nSeason : " + s[0] + "\n");
break;
case 3 : System.out.println("\n\nMonth : " + m[2] );
System.out.println("\n\nSeason : " + s[0] + "\n");
break;
case 4 : System.out.println("\n\nMonth : " + m[3] );
System.out.println("\n\nSeason : " + s[1] + "\n");
break;
case 5 : System.out.println("\n\nMonth : " + m[4] );
System.out.println("\n\nSeason : " + s[1] + "\n");
break;
case 6 : System.out.println("\n\nMonth : " + m[5] );
System.out.println("\n\nSeason : " + s[2] + "\n");
break;
case 7 : System.out.println("\n\nMonth : " + m[6] );
System.out.println("\n\nSeason : " + s[2] + "\n");
break;
case 8 : System.out.println("\n\nMonth : " + m[7] );
System.out.println("\n\nSeason : " + s[3] + "\n");
break;
case 9 : System.out.println("\n\nMonth : " + m[8] );
System.out.println("\n\nSeason : " + s[3] + "\n");
break;
case 10 : System.out.println("\n\nMonth : " + m[9] );
System.out.println("\n\nSeason : " + s[4] + "\n");
break;
case 11 : System.out.println("\n\nMonth : " + m[10] );
System.out.println("\n\nSeason : " + s[4] + "\n");
break;
case 12 : System.out.println("\n\nMonth : " + m[11] );
System.out.println("\n\nSeason : " + s[5] + "\n");
break;
}
}
}
No comments:
Post a Comment