Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Cameron Craik
- //Block D
- public class Year
- {
- public static void main(String args[])
- {
- YearToo CurrentYear = new YearToo();
- CurrentYear.NumberInfo(2000);
- System.out.println(CurrentYear.getIfLeapYear());
- }
- }
- ------------------------------------------------------------
- public class YearToo
- {
- private boolean Leap;
- private int num;
- public int NumberInfo(int num)
- {
- return num;
- }
- public boolean getIfLeapYear()
- {
- if(num%4 == 0)
- {
- if(num%100 == 0)
- {
- Leap = false;
- return Leap;
- }
- else
- {
- Leap = true;
- return Leap;
- }
- }
- else
- {
- Leap = false;
- return Leap;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement