Is 2000 a leap year?
transcript
Is the year two thousand a leap year? Many calendars say no. They are wrong. Every fourth year is a leap year, but not all of them.
A leap year is divisible by four. Except when it is divisible by one hundred. Unless it is also divisible by four hundred. Say it aloud once, and then code it exactly.
Nineteen hundred is not a leap year. Two thousand is a leap year. Twenty-one hundred is not. The centuries are where the rule matters.
The short test stops at the hundreds. It gives two thousand three hundred sixty-five days. Add the four hundred rule, and it gets three sixty-six. So test both sides of every century rule.
One missing day shifts the day count. Then every weekday after it is wrong. The samples rarely include a year like two thousand. Always test the years nineteen hundred and two thousand.
Test 1900 and 2000. They sit on either side. Full breakdown in the lecture.