Write a Java program using Switch-case construct to accept month number and display the
respective season
For month January, November and December the season is Winter, month of February and
March is Spring, April May and June is Summer, July, August and September is Rainy season
and rest of the months are Autumn
please answer it ASAP
will mark as brainliest
Answers
Answered by
1
Answer:
import java.util.*;
class season
{
public static void main (String args [])
{
Scanner sc=new Scanner (System.in);
System.out.println("Enter The Month Number eg: 1 for January...");
int ch=sc.nextInt();
switch(ch)
{
case 1:
case 12:
case 11:
System.out.println("Winter");
break;
case 2:
case 3:
System.out.println("Spring");
break;
case 4:
case 5:
case 6 :
System.out.println("Summer");
case 7:
case 8:
case 9 :
System.out.println("Rainy");
break;
case 10:
System.out.println("Autumn");
break;
default:
System.out.println("Wrong Output");
}
}
}
Please Subscribe my Youtube Channel Study To Study ICSE-Swapnil Mehta for more Java Programs :)
Explanation:
Hope this help you
Thank you
Please mark me as brainlist :)
Similar questions
Physics,
4 months ago
Art,
4 months ago
Math,
4 months ago
Social Sciences,
9 months ago
Environmental Sciences,
1 year ago