title: Why am I getting a "Exception in thread "main" java.util.NoSuchElementException" error on a online coding class code checker?
body: <p>Every time I run the code on BlueJ, Vscode, and/or Atom it works perfectly fine.  However it never works on the code checker.</p>
  <pre class="lang-java prettyprint-override"><code> import java.util.Scanner;
      import java.lang.Math;
  
      class Lesson_20_Activity {
      public static void main(String[] args) {
          Scanner scan = new Scanner (System.in);
          
          double fNorth = 0;
          
          double input = 0;
          
          double fSouth = 0;
          
          double fEast = 0;
          
          double fWest = 0;
          
          int cont = 1;
          
          double input2 = 0;
          
          while(cont == 1 ){
              
              System.out.println(&quot;Please enter the latitude: &quot;);
              input = scan.nextDouble();
                   
                  if(input &gt;=-90.0 &amp;&amp; input &lt;= 90.0){
                  
                      if(fNorth == 0.0){
                      
                      fNorth = input;
                      
                      fSouth = input;
                      
                    }
                    else{
                      
                      if(input&lt;fSouth){
                          fSouth = input;
                      }
                      else if (input&gt;fNorth){
                          
                          fNorth = input;
                          
                      }          
                   }
                  
               }
              
              System.out.println(&quot;Please enter the longitude&quot;);
              input2 = scan.nextDouble();
              
              if(input2 &gt;= -180.0 &amp;&amp; input2 &lt;= 180.0){
                  
                  if(fWest == 0){
                      
                      fWest = input2;
                      
                      fEast =  input2;
                      
                  }
                  else{
                      
                      if(input2&lt;fWest){
                          
                          fWest = input2;
                          
                      }
                      
                      else if(input2&gt;fEast){
                          fEast = input2;
                      }
                  }
                  
              }
              else{
                  
                  System.out.println(&quot;Please enter the longitude:&quot;);
              }
              System.out.println(&quot;Would you like to enter another location?&quot;);
              cont = scan.nextInt();
              
              if(cont == 0){   
                  System.out.println(&quot;Farthest North: &quot; + fNorth);
              
                  System.out.println(&quot;Farthest South: &quot; + fSouth);
              
                  System.out.println(&quot;Farthest East: &quot; + fEast);
              
                  System.out.println(&quot;Farthest West: &quot; + fWest);
              }
          }
  
      /*
       * Write your code here Copy and paste your entire program to Code Runner to
       * complete the activity, from the first import statement to the last bracket.
       */
    }
    }
  </code></pre>
  <p>Here's the error that appears:</p>
  <pre class="lang-none prettyprint-override"><code>Exception in thread &quot;main&quot; java.util.NoSuchElementException
          at java.util.Scanner.throwFor(Scanner.java:862)
          at java.util.Scanner.next(Scanner.java:1485)
          at java.util.Scanner.nextDouble(Scanner.java:2413)
          at Lesson_20_Activity.main(Main.java:380)
          at Ideone.assertRegex(Main.java:85)
          at Ideone.assertRegex(Main.java:76)
          at Ideone.test(Main.java:40)
          at Ideone.main(Main.java:29)
  </code></pre>
  <p>I don't know what else to do now. I really need help to resolve this.</p>