Srinivas Kumar
Write a java program to display the season given the month using switch case
1 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions

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

Advertisement
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
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
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
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
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
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 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
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
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
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
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 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
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
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>
Case Java Keyword
statement in java program. In other word Case is a java keyword... block in java program.  In statement case keyword having break statement... Case Java Keyword      
Switch
C:\javac>java Switch friday In this case, "...; 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
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
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
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
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 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  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 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