title: Java, even number of even digits, odd number of odd digits
body: <p>This program is essentially a game where the user must enter numbers to see which numbers are good: numbers with an even number of even digits, and an odd number of odd digits. </p>
  
  <p>So first of all, the program ends when I enter a one digit number, which is not intentional. I assume that has something to do with the while being while (<code>n &gt; 0</code>). There also is likely an issue with the if (<code>numEven % 2 == 0</code>......) because the print results seem almost random, with a number being good and the same number not being good sometimes. </p>
  
  <p>Honestly, I am lost at this point. Thank you so much in advance for any help.</p>
  
  <p><strong>UPDATE</strong>: This code is working how I want it to, I just wanted to thank everybody who helped out! It's my first semester of computer science class, so I'm still rather new at this...excuse my mistakes that were likely pretty stupid :)</p>
  
  <pre><code>package quackygame;
  import java.util.Scanner;
  public class QuackyGame 
  {
      public static void main(String[] args) 
     {
         System.out.println("Welcome to the Number Game!"
                  + " Try to figure out the pattern "
                  + "in the numbers that Wallace likes!");
  
          Scanner scan = new Scanner (System.in);
          int n;
          int numEven = 0;
          int numOdd = 0;
          boolean isEven;
  
          do
          {
             System.out.print("Enter a number &gt; 0: ");
             n = scan.nextInt();
             while (n &gt; 0)
             {
                 if (n % 2 == 0)
                   {
                     //n is even
                     isEven = true;
                     numEven++;
                   }
                  else
                   {
                     //n is odd
                     isEven = false;
                     numOdd++;
                   }
                 n /= 10;
             }
             //if numEven is even and numOdd is odd
             if (numEven % 2 == 0 &amp;&amp; numOdd % 2 == 1)
                 System.out.println("Wallace liked your number!");
             else
             {
                 System.out.println("Wallace didn't like your number.");
             }
             numEven = 0;
             numOdd = 0;
  
          }
  
          while (n &gt;= 0); 
      }
  
  }
  </code></pre>