Write a java program to display the season given the month using switch case

Write a java program to display the season given the month using switch case

Write a java program to display the season given the month using switch case

View Answers

July 2, 2012 at 5:47 PM

import java.util.Scanner;
class switch{
   public static void main(String[] args)
{
    int season =0;
    Scanner sc =new Scanner (System.in);
    System.out.println();
    System.out.println("Enter the season number");
    season = sc.nextInt();  
    switch(season)
    {
      case 1:
      System.out.println("Jan");
      break;
      case 2:
      System.out.println("Feb");
      break;
      case 3:
      System.out.println("mar");
      break;
case 4:
      System.out.println("Apr");
      break;
case 5:
      System.out.println("May");
      break;
case 6:
      System.out.println("June");
      break;
case 7:
      System.out.println("July");
      break;
case 8:
      System.out.println("Aug");
      break;
case 9:
      System.out.println("Sep");
      break;
case 10:
      System.out.println("Oct");
      break;
case 11:
      System.out.println("Nov");
      break;
case 12:
      System.out.println("Dec");
      break;
default:
      System.out.println("Not Session Data Found!!!");
      break;
    }
}
}









Related Tutorials/Questions & Answers:
Write a java program to display the season given the month using switch case
Write a java program to display the season given the month using switch case  Write a java program to display the season given the month using switch case
using switch case
using switch case  Define a class MENU to perform the following operation depending upon the users choice using switch case 1)print square root... choice: "); int choice=input.nextInt(); switch(choice
Advertisements
Switch Case in Java
. Switch statements with String cases are supported in Java SE 7 but the earlier version of Java did not support String in switch/case. Switch statements works...It is very difficult and lengthy to write programs using
switch case instead of if else
switch case instead of if else  How to write code in switch case instead of if else in Java
Write a program that converts any given year to Roman Numeral in Java
Write a program that converts any given year to Roman Numeral in Java  Write a program that converts any given year to Roman Numeral
Switch Case - Java Interview Questions
Switch Case  int x=100000; switch(x) { case 100000: printf("Lacks"); } output= Lacks I want reason why x matches switch case although range for int is in between something -32678 to +32676. Plz give me ans quickly
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
write a java pogram to add elements to linked list using keyboard and display it
write a java pogram to add elements to linked list using keyboard and display it  write a java pogram to add elements to linked list using keyboard and display
write a java program for inserting a substring in to the given main string from a given position
write a java program for inserting a substring in to the given main string from a given position  write a java program for inserting a substring in to the given main string from a given position
to write a program to display the employee details..
to write a program to display the employee details..  To dipslay the employee details like empid,empname,salary,wonno bye using java swings.by running this program the new window has to be opened asking us to enter all
Switch case in java
Switch case in java In this section we will learn about switch case in java..., and java, switch case is used . switch  is a selection control mechanism used... will illustrate the use of switch case in java: import java.util.Scanner; public
Find Capital using Switch-Case statement
Find Capital using Switch-Case statement In this Java Tutorial section, we are going to find the capital of our states using Switch-Case statement. For this, we have created two arrays i.e. array of states and array of capitals. Then we
Write a query to display a row using index
Write a query to display a row using index  Write a query to display a row using index
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
write a program in java to read a text file and write the output to an excel file using filereader and filewriter?
write a program in java to read a text file and write the output to an excel file using filereader and filewriter?  write a program in java to read a text file and write the output to an excel file using filereader and filewriter
Hi..How to Display Days by month - Java Beginners
Hi..How to Display Days by month  Hi Friend.... I have a doubt on date Program... How to display the Number of days..it should display Separate .Month by Month For Ex.. INPUT: ---------------- Year Month Day 2006 12
convert date month and year into word using java
convert date month and year into word using java  convert the date... send the code write in java.   import java.util.*; import java.text....) { switch (n) { case 1
convert date month and year into word using java
convert date month and year into word using java  convert the date... send the code write in java.   import java.util.*; import java.text....) { switch (n) { case 1
Switch case + condition??
Switch case + condition??  I try to use a switch case with condition but it doesn't display anything have look: ......public void commandAction...(); } } else { List down = (List)display.getCurrent(); switch
Switch
; Sometimes it becomes cumbersome to write lengthy programs using if and if-else statements. To avoid this we can use Switch statements in Java. The switch statement... of a variable or expression. The switch statement in Java is the best way to test
using if and switch stmt - Java Beginners
be assumed. Write a program using "switch and if statement" to compute net amount...using if and switch stmt  A cloth showroom has announced...(); switch(menu) { case 1: System.out.print("Quantity: "); int q1 = scan.nextInt
Write a program to display grade message according to the marks
Write a program to display grade message according to the marks  pls give d answer how to Write a program to display grade message according to the marks     Write a program to display grade message according
Case Java Keyword
statement in java program. In other word Case is a java keyword... block in java program. ADS_TO_REPLACE_1 In statement case keyword having... Case Java Keyword      
write a java program
write a java program  write a program to print '*' in a circular form
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
ModuleNotFoundError: No module named 'switch-case'
ModuleNotFoundError: No module named 'switch-case'  Hi, My Python... 'switch-case' How to remove the ModuleNotFoundError: No module named 'switch-case' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'switch-case'
ModuleNotFoundError: No module named 'switch-case'  Hi, My Python... 'switch-case' How to remove the ModuleNotFoundError: No module named 'switch-case' error? Thanks   Hi, In your python environment
convert date month and year into word using java
convert date month and year into word using java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
convert date month and year into word using java
convert date month and year into word using java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
convert date month and year into word using java
convert date month and year into word using java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
how to write a program to search a record using mvc2
how to write a program to search a record using mvc2   how can we write a code to search a record in table by using java bean as model, servlet as contoller and jsp as view
Switch case in Jsp page
using switch case in jsp page...Switch case in Jsp page  <table> <tr><td>Enter Distance :</td> <td><input type="text" name="dis"/></td>
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
convert date month and year into word using java
Java Date Month Format  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
convert date month and year into word using java
convert date month and year Java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
convert date month and year into word using java
convert date month and year  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
convert date month and year into word using java
Convert Date Month format  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Write a JSP program to display the grade of a student by accepting the marks of five subjects.  Write a JSP program to display the grade of a student by accepting the marks of five subjects
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  How do I write a program in Java, have the program display a message with your name in it and a number (Hello john Smith!1) The number must increment from zero to nine, or decrement fron nine to zero. You
write the java program?
write the java program?  1 11 121 1331 14641 15101051
write the java program?
write the java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
Write an applet to display scrolling image in an applet window using thread.
Write an applet to display scrolling image in an applet window using thread.  Write an applet to display scrolling image in an applet window using thread
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
write program have product - using loops
write program have product - using loops  Write a program for a grocery that reads products data and determine and display the product that has...), name (String) and price (double). Your program should continue reading new
convert date month and year into word using java
Match Date format  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls send the code write in java.   Visit Here

Ads