Posted by: SAJHACOP September 28, 2006
Login in to Rate this Post:
0
?
public boolean isLeap(int y){
if(y%4==0)
return true;
else
return false;
}
************
public void addDay(int d) {
day=d+1;
if(day > 28)
{
if((month==2)&&(isLeap(year))){
day-=28;
addMonth(1);
}
else if((month==2)&&(!isLeap(year))){
day-=28;
addMonth(1);
}
...
Leap year is always divisible by 4. I don't know why you are using y%400 and y%100.