Advertisement
GameNCode

Date Main

Feb 3rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. /**
  2. * Created by Roy Weisfeld on 2/3/2017.
  3. */
  4. import java.util.*;
  5.  
  6. public class main {
  7. public static void main(String []args)
  8. {
  9. Scanner UI = new Scanner(System.in);
  10. System.out.println("Enter date (Day, Month, Year)");
  11. Date date = new Date(UI.nextInt(),UI.nextInt(), UI.nextInt());
  12. if(date.getMonth() == 12 || date.getMonth() <= 3)
  13. {
  14. System.out.println("winter");
  15. }
  16. else if(date.getMonth() == 4 || date.getMonth() == 5)
  17. {
  18. System.out.println("spring");
  19. }
  20. else if(date.getMonth() >= 6 && date.getMonth() <= 9)
  21. {
  22. System.out.println("summer");
  23. }
  24. else if(date.getMonth() == 10 || date.getMonth() == 11)
  25. {
  26. System.out.println("autumn");
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement