
part a
public static boolean isLeapYaer(int year)
Write the static method isLeapYear(int year) which returns true or false.
a year is leap year if
- It is divisible by 4
- However, if it is also divisible by 100 it is not a leap year
- Unless it is divisible by 400, in which case it is a leap year
example calls:
- isLeapYear(2020) → true
- isLeapYear(1900) → false
- isLeapYear(2000) → true
- isLeapYear(2023) → false
- isLeapYear(2100) → false
part b
public static int numbrOfLeapYears(int year1, int year2)