Difficulty with methods
<p>My code seems to be working partially: What I mean is that when I don't enter a leap year for example 99 end then i choose 2 for february it prints 29 days,I would like to print 28 I have 2 separete methods, one to check if the year is leap or not and the other one to print the days in month so if someone know how to repair the program to be more efficient and for not leap year to display 28 days I would be grateful. Thank you. </p>

<p>Here is my code:</p>

<pre><code>import java.util.Scanner;
public class LeapYearCheck
{
    public static void main(String[] args) 
    {
        LeapYearCheck.isLeapYear();
        LeapYearCheck.daysInMonth();
    }

    static void isLeapYear()
    {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter a year: ");
        int year = input.nextInt();

        if(year % 4 == 0 || year % 400 ==0) 
        {
            System.out.println(year + " is leap year:");
        }
        else 
        {
            System.out.println(year + " is not leap year:");
        }
    }

    static void daysInMonth()
    {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter a month :");
        int month = input.nextInt();

        if (month == 2)
        {
            System.out.println("There are 29 days in February: ");
        }
        else if(month == 1)
        {
            System.out.println("The are 31 days in January ");
        }
        else if(month == 2)
        {
            System.out.println("The are 28 days in February ");
        }
        else if(month == 3)
        {
            System.out.println("The are 31 days in March ");
        }
        else if(month == 4)
        {
            System.out.println("The are 30 days in April");
        }
        else if(month == 5)
        {
            System.out.println("The are 31 days in May ");
        }
        else if(month == 6)
        {
            System.out.println("The are 30 days in June  ");
        }
        else if(month == 7)
        {
            System.out.println("The are 31 days in July  ");
        }
        else if(month == 8)
        {
            System.out.println("The are 31 days in August ");
        }
        else if(month == 9)
        {
            System.out.println("The are 30 days in September  ");
        }
        else if(month == 10)
        {
            System.out.println("The are 31 days in  October ");
        }
        else if(month == 11)
        {
            System.out.println("The are 30 days in November ");
        }
        else if(month == 12)
        {
            System.out.println("The are 31 days in December ");
        }
        else 
        {
            System.out.println("Invalid Month, Please enter a number between 1 &amp; 12 Merci: ");
        }
    }
}
</code></pre>
