Leap year exercise is wrong

Point 2. in the instructions states “Checks to see if the year is a four-digit number.”
But if you enter the year 800 for example it works anyways.

The way the code is written, it only checks if the year is a positive number below 10000.
The instructions should be corrected or the if statement written like something like this:

if (y > 999 && y < 10000) {
// some code
}

(Sorry for the dramatic title :stuck_out_tongue: )

1 Like

Hi @leecaste

You’re right - the instructions ask you to validate that the year is a 4-digit number but the solution doesn’t perform that check. :slight_smile:

Thanks for pointing that out. :slight_smile:

2 Likes