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

Ads
 

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;
    }
}
}

Ads









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
version of Java did not support String in switch/case. Switch statements works... case will take place. Example of Switch Statement in Java: import java.io....It is very difficult and lengthy to write programs using
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
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
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
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
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
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
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 program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
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
write a java program
write a java program  write a program to print '*' in a circular form
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 programm using java
write a programm using java  print the following using java programming
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
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
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
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 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 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
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
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

Ads