Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Roy Weisfeld on 2/3/2017.
- */
- import java.util.*;
- public class main {
- public static void main(String []args)
- {
- Scanner UI = new Scanner(System.in);
- System.out.println("Enter date (Day, Month, Year)");
- Date date = new Date(UI.nextInt(),UI.nextInt(), UI.nextInt());
- if(date.getMonth() == 12 || date.getMonth() <= 3)
- {
- System.out.println("winter");
- }
- else if(date.getMonth() == 4 || date.getMonth() == 5)
- {
- System.out.println("spring");
- }
- else if(date.getMonth() >= 6 && date.getMonth() <= 9)
- {
- System.out.println("summer");
- }
- else if(date.getMonth() == 10 || date.getMonth() == 11)
- {
- System.out.println("autumn");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement