title: Problem with do while loop in JavaSE
body: <p>i'm new to programming so consider me a great newbie.
  Dilemma:
  I want to repeat my code each time I respond to Yes.
  I do use the "do while loop" because a statement comes first and the boolean condition should be evaluated at last.</p>
  
  <p>The code:</p>
  
  <pre><code>import java.util.Scanner;
  
  class whysoserious {
  
      public static void main(String[] args) {
          Scanner sc = new Scanner(System.in);
  
          do{
          String go = YES;
  
          int setone = 0;
          int settwo = 0;
  
          System.out.println("Enter two numbers: ");
  
          setone = sc.nextInt();
          settwo = sc.nextInt();
          int set = setone + settwo;
  
  
          System.out.println("What is " +setone+ " + " +settwo+ " ? ");
          int putone = 0;
          putone = sc.nextInt();
  
          if (putone == set) 
              System.out.println("Correct!");
  
          else
              System.out.println("Wrong Answer - The correct answer is: "+set+"");
  
          System.out.println("Continue?");
          cont = sc.nextLine();
          } while (cont == go);
      }
  }
  </code></pre>
  
  <p><strong>I was asked to add CMD-prompt line.</strong></p>
  
  <ul>
  <li>C:\test>javac whysoserious.java
  whysoserious.java:15: cannot find
  symbol symbol  : variable YES
  location: class whysoserious
                 String go = YES;
                             ^ whysoserious.java:38: cannot find
  symbol symbol  : variable cont
  location: class whysoserious
                 cont = sc.nextLine();
                 ^ whysoserious.java:39: cannot find
  symbol symbol  : variable cont
  location: class whysoserious
                 } while (cont == go);
                          ^ whysoserious.java:39: cannot find
  symbol symbol  : variable go
  location: class whysoserious
                 } while (cont == go);
                                  ^ 4 errors</li>
  </ul>
  
  <p>I always get an error each time I try to compile it. The knowledge behind this is that I want to repeat the code every time the user enters Yes or No to continue. Observe that the code works without the do {. At this point, i'm stuck with the do while. </p>