Off Topic: The Flood
This topic has moved here: Subject: Computer science help!
  • Subject: Computer science help!
  • Pages:
  • 1
  • 2
  • of 2
Subject: Computer science help!

Proud member of the EFF.
Proud member of the FSF.
EFF | FSF | GNU

News: /. | Cryptome | Ars Technica

Heavy weighs the crown, low hangs the head who wears it.

That's pretty easy.. All you have to do is check if mod 400 is 0, else if mod 4 is 0, and mod 100 is not. You return True or False.

  • 12.09.2012 11:46 PM PDT

Posted by: SRQ baller24
Posted by: Hylebos
Posted by: SRQ baller24
Isn't the year 100 (one of many examples I have) a leap year? yet your conditions say it isn't?

Or am I misinterpreting?
Per his conditions it wouldn't be.

I just thought his conditions were supposed to be representative of real life.
That's why it's better to use library code.

  • 12.09.2012 11:52 PM PDT

"Your eyes are full of hate, forty-one. That's good. Hate keeps a man alive. It gives him strength"

I'm in trouble again,

I've got everything in this project down but for some reason, the code is returning every single year as leap years

public static boolean isLeap (int year)

{

if( (year%400==0)||((year%4==0)&&(year%100!=0)));
{
return true;
}


}

Thats my code, whats the problem?

  • 12.15.2012 10:10 PM PDT

  • Pages:
  • 1
  • 2
  • of 2