Richard_Sekol

project 5.5

Oct 17th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. package chapter5;
  2.  
  3. public class project5dot5 {
  4. int year = 1997;
  5. boolean leapYear = true;
  6. public void isLeapYear()
  7. {
  8. if (year >= 1582 && year % 4 == 0);
  9. {leapYear = true;
  10. if (year % 100 == 0 && year % 400 != 0){leapYear = false;}
  11. if (leapYear = true){System.out.println("it's a leap year");}
  12. else{System.out.println("it is not a leap year");}
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment