|
|
|
|
|
by sebastialonso
836 days ago
|
|
Wow the way this is presented is super confusing, to the point that your description includes a contradiction. Specifically, of a year is divisible by 400 it's also divisible by 100, so it's both a leap year and not leap year! Instead of showing rules as a linear list, I'd suggest it's easier to visualise it as a tree, or simpler still, as a series of nested ifs. |
|
Best to describe it as a flowchart
* Is the year divisible by 400? YES -> Leap year
* NO -> Is the year divisible by 100? YES -> Not leap year
* NO -> Is the year divisible by 4? YES -> Leap year
* NO -> Not leap year