Advertisement
CR7CR7

season

Oct 28th, 2022
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Main {
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.         String month = input.nextLine();
  8.         int day = Integer.parseInt(input.nextLine());
  9.         if (month.equals("March") && day >= 20 ||
  10.                 month.equals("April") ||
  11.                 month.equals("May") ||
  12.                 month.equals("June") && day <= 20) {
  13.             System.out.println("Spring");
  14.         }else
  15.         if(month.equals("June") && day >= 21 ||
  16.                 month.equals("July") ||
  17.                 month.equals("August") ||
  18.                 month.equals("September") && day <= 21){
  19.             System.out.println("Summer");
  20.         }else
  21.         if(month.equals("September") && day >= 22 ||
  22.                 month.equals("October") ||
  23.                 month.equals("November") ||
  24.                 month.equals("December") && day <= 20){
  25.             System.out.println("Autumn");
  26.         }else{
  27.             System.out.println("Winter");
  28.         }
  29.  
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement