rockoverlord23

Untitled

Oct 17th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. P5.5
  2. Ryan west
  3. D block
  4.  
  5. package yearc;
  6.  
  7. public class IsLeapyear {
  8. public static void main(String[] args)
  9. {
  10. Year X = new Year();
  11.  
  12. if(X.Getvalue() == 4);
  13. {
  14. System.out.println("leap year");
  15. }
  16. if(X.Getvalue() < 4);
  17. {
  18. System.out.print("common year");
  19. }
  20. }
  21.  
  22. }
  23.  
  24. package yearc;
  25.  
  26. import java.util.Random;
  27. public class Year
  28. {
  29. private Random generator = new Random();
  30. private int year = generator.nextInt(5);
  31.  
  32.  
  33. public int Getvalue()
  34. {
  35. return year;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment