Started By
Message

re: C# Help. I always have dumb face on.

Posted on 2/4/15 at 4:41 pm to
Posted by MamouTiger65
Baton Rouge, La
Member since Oct 2007
799 posts
Posted on 2/4/15 at 4:41 pm to
This is just translating the requirements he gave you into syntax. Once you get more familiar with the syntax you will start to see it form as you read the requirements.

(year % 4 == 0) means that the year is divisible by 4. If anything but 0 came back it means that there is a remainder and it isn't divisible.

For the centennial we check year % 100 and then year % 400.

This mean that year is divisible by 4 and not a centennial.
(year % 4 == 0 && year % 100 != 0)

This means that year is divisible by 4 and is divisible by 400.
(year % 4 == 0 && year % 400 == 0)

So we say if either of those statements is true, then the month will have 29 days.

if((year % 4 == 0 && year % 100 != 0) || (year % 4 == 0 && year % 400 == 0))
first pageprev pagePage 1 of 1Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram