0% found this document useful (0 votes)
7 views

Java Project

Uploaded by

Tejaswini Beri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Java Project

Uploaded by

Tejaswini Beri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

JAVA PROJECT

TEJASWINI.BERI
227Z1A6610
CSE(AIML-A)
AIM: - WRITE A JAVA PROGRAM TO PRINT THE
SEASON NAMES BASED ON MONTH GIVEN BY USER.

SOURCE CODE: -
import java. util. Scanner;
public class Switch_Demo
{
public static void main (String args [])
{
String season;
System.out.println("Enter any month (1 to 12)");
Scanner s = new Scanner(System.in);
int entry = s. extent ();
switch (entry)
{
case 12:
case 1:
case 2:
season = "Winter";
break;
case 3:
case 4:
case 5:
season = "Spring";
break;
case 6:
case 7:
case 8:
season = "Summer";
break;
case 9:
case 10:
case 11:
season = "Autumn";
break;
default:
season = "Bogus Month";
}
System.out.println("The entered month is in the "
+season + ".");
}
}
OUTPUT: -

You might also like