If you are not sure what the results of your conditions, print them all out and see what they return.
For example:
System.out.println("(year % 4 == 0)=" + (year % 4 == 0));
Do that for all the conditions and you should see where the problem is.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
if (isLeapYear = true)
This get LOTS and LOTS of students in trouble.
A boolean variable does NOT need to be tested if it is equal to true. It is TRUE or FALSE.
if (isLeapYear)
The problem comes when the OP uses the wrong operator.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656