Calculating number of days in a month Based on leap year?
<p>I need help making a program that takes the user input of a year and month (Ex. 2012 3) and outputs the number of days in it, BUT, it has to do so by determining whether it is a leap year or not  so that it can tell how many days the months have, so it cannot be pre-programmed, it must calculate on its own. AND it must prompt to re-input when an invalid month is entered (1-12 only) or negative integers/decimals are input. I have no clue how to start this!</p>

<p>I did start else i would not have asked,</p>

<p>System.out.println("Enter year and month: ");</p>

<pre><code>    if (stdin.hasNextInt()) {
         yes = true;
    int year =  stdin.nextInt();
    int month = stdin.nextInt();
    }
        else {
            System.out.println("Invalid Input. ");}

    if (yes = true);

    }
}
</code></pre>

<p>I dont know how to get it to take in the two numbers as separate INTs (2012 3) and how to reject month if its invalid or year if its invalid....</p>
