This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Assignment 1.3 -  conflicting Specs. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Assignment 1.3 -  conflicting Specs." Watch "Assignment 1.3 -  conflicting Specs." New topic

Assignment 1.3 - conflicting Specs.

Shama Khan
Ranch Hand

Joined: Aug 14, 2000
Posts: 185
Assignment wording:
a leap year occurs on every year that is evenly divisible by 4
except every year that is evenly divisible by 100
except every year that is evenly divisible by 400.
>java Leap 2000
>leap year!

My words: The way I am reading the specs, the year 2000 shouldn't be a leap year because eventhough it's divisible by 4, it is also divisible by 100 and 400!
so is the year 100 or 400 a leap year or not?
I read the specs so many times before finally posting this!

Rosie Suayan

Joined: Nov 29, 2000
Posts: 7
2000 is divisible by 4 therefore it is a leap year,
but 2000 is divisible by 100 so it's not a leap year,
but 2000 is divisible by 400 so it is a leap year.
A leap year happens every 4 years. But years divisible by 100 aren't leap years unless they are also divisible by 400.
Hope that sort of clears it up?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Assignment 1.3 - conflicting Specs.
It's not a secret anymore!