Advertisement
mcnealk

4-3

Oct 29th, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. /**
  3. * Write a description of class E3 here.
  4. *
  5. * @author Kailey McNeal
  6. * @version 10-24-14
  7. * p305 #3
  8. */
  9. public class E3
  10. {
  11. public static void main(String []args)
  12. {
  13. season(1,6);
  14. }
  15. public static void season(int m, int d)
  16. {
  17. if(m==12 && d<=16 || m<=3 && d>=15)
  18. {
  19. System.out.println("winter");
  20. }
  21. else if(m==3 && d<=16 || m<=6 && d>=15)
  22. {
  23. System.out.println("spring");
  24. }
  25. else if(m==6 && d<=16 || m<=9 && d>=15)
  26. {
  27. System.out.println("summer");
  28. }
  29. else if(m==9 && d<=16 || m<=12 && d>=15)
  30. {
  31. System.out.println("fall");
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement