public int daysInMonth(int month, int year)
{
int daysInMonth ;
daysInMonth = 0 ;
boolean leap ;
leap = false ;
if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
daysInMonth = 31 ;
} else {
if (month == 4 || month == 6 || month == 9 || month == 11) {
daysInMonth = 30 ;
} else {
if(isACenturyYear(year) || month == 2) {
leap = isDivisibleBy(year,400) ;
} else {
leap = isDivisibleBy(year,4) ;
}
daysInMonth = 29 ;
if (isACenturyYear(year) || month == 2) {
leap =! isDivisibleBy(year,400) ;
} else {
leap =! isDivisibleBy(year,4) ;
}
daysInMonth = 28 ;
}
}
return daysInMonth ;
}