Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dadaproject.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner month = new Scanner(System.in);
- System.out.println("Enter the month:");
- int month1 = month.nextInt();
- switch (month1){
- case 1 :
- System.out.println("The month is spring.");
- break;
- case 2 :
- System.out.println("The month is spring.");
- break;
- case 3 :
- System.out.println("The month is summer.");
- break;
- case 4 :
- System.out.println("The month is summer.");
- break;
- case 5 :
- System.out.println("The month is summer.");
- break;
- case 6 :
- System.out.println("The month is autumn.");
- break;
- case 7 :
- System.out.println("The month is autumn.");
- break;
- case 8 :
- System.out.println("The month is autumn.");
- break;
- case 9 :
- System.out.println("The month is winter.");
- break;
- case 10 :
- System.out.println("The month is winter.");
- break;
- case 11 :
- System.out.println("The month is winter.");
- break;
- case 12 :
- System.out.println("The month is winter.");
- break;
- default:
- System.out.println("Invalid month enterd.");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement