Advertisement
chiplu

Java season program

Nov 17th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.68 KB | None | 0 0
  1. package dadaproject.company;
  2. import java.util.Scanner;
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner month = new Scanner(System.in);
  7.         System.out.println("Enter the month:");
  8.         int month1 = month.nextInt();
  9.         switch (month1){
  10.             case 1 :
  11.                 System.out.println("The month is spring.");
  12.                 break;
  13.             case 2 :
  14.                 System.out.println("The month is spring.");
  15.                 break;
  16.             case 3 :
  17.                 System.out.println("The month is summer.");
  18.                 break;
  19.             case 4 :
  20.                 System.out.println("The month is summer.");
  21.                 break;
  22.             case 5 :
  23.                 System.out.println("The month is summer.");
  24.                 break;
  25.             case 6 :
  26.                 System.out.println("The month is autumn.");
  27.                 break;
  28.             case 7 :
  29.                 System.out.println("The month is autumn.");
  30.                 break;
  31.             case 8 :
  32.                 System.out.println("The month is autumn.");
  33.                 break;
  34.             case 9 :
  35.                 System.out.println("The month is winter.");
  36.                 break;
  37.             case 10 :
  38.                 System.out.println("The month is winter.");
  39.                 break;
  40.             case 11 :
  41.                 System.out.println("The month is winter.");
  42.                 break;
  43.             case 12 :
  44.                 System.out.println("The month is winter.");
  45.                 break;
  46.                 default:
  47.                     System.out.println("Invalid month enterd.");
  48.                     break;
  49.  
  50.  
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement