title: Determining cool numbers?
body: <p>I'm working on a program which determines a cool number. A cool number is any number that has a remainder of 1 when divided by 3,4,5, and 6. The method iscoolNum will determine if a number is a cool number. The method countCoolNumbers will count the number of cool numbers between 6 and the parameter passed in. Here's an example of what I have so far in the class:</p>
  
  <pre><code>import static java.lang.System.*;
  
  public class CoolNumbers 
  </code></pre>
  
  <p>{</p>
  
  <pre><code>public static boolean isCoolNumber( int num )
  { 
       int x; 
      x = 6;
      for(x = 6; x&lt;num; x++)
      {
      if ((x%3==1)  &amp;&amp;  (x%4==1)  &amp;&amp; (x%5 ==1) &amp;&amp; (x%6 == 1))
  
          return true;
  
      }
       return false;
  }
  
  
  public static int countCoolNumbers( int stop )
  {
       boolean check=isCoolNumber(stop);
       int b=0;
    for(b=0;b&lt;stop;b++);
     {
      if(check==true)
      {
  
      }
      else
      {
          b=b-1;
      }
   return b;
  
  }
  </code></pre>
  
  <p>}
  }</p>
  
  <p>The code in the main:</p>
  
  <pre><code>import static java.lang.System.*;
  
  public class CoolNumbersRunner
  </code></pre>
  
  <p>{</p>
  
  <pre><code>public static void main( String[] args )
  {
  
      System.out.println( CoolNumbers.countCoolNumbers(250) + " cool numbers between 6 - " + 250);
      //add more test cases
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem I have is when i run the program, the output is "250 cool numbers between 6-250" whereas it should only be 4 cool numbers through 6-250. I cant quite figure out how to properly use the for loop and such. Sorry if some things seem off, Im very new to Java. Thanks in advance</p>