title: Java: Ask for continue
body: <p>I'm trying to make a calculator. These operators: <code>x</code>, <code>+</code>, <code>-</code>, <code>/</code> work fine.</p>
  
  <p>But I want the user to be able to do 2 things after he gets the answer on his math problem.</p>
  
  <p>Ask user if he wants to continue.</p>
  
  <ol>
  <li>If user types in <code>yes</code> he gets to put in 2 numbers that it counts again.</li>
  <li>If the user types <code>no</code> just shut down.</li>
  </ol>
  
  <p>Here's my code: </p>
  
  <pre><code>import java.util.Scanner;
  
  public class Main {
      public static void main(String[] args) {
          Scanner Minscanner = new Scanner(System.in);
          int nr1 = Integer.parseInt(Minscanner.nextLine());
          int nr2 = Integer.parseInt(Minscanner.nextLine());
          int yes = Integer.parseInt(Minscanner.nextLine());//trying to fix reset
          int ans =0;
          int reset = J;/trying to make it reset if user types in yes
          String anvin = Minscanner.nextLine();
  
          if(anvin.equalsIgnoreCase("+")) {
              ans = nr1 + nr2;
          }
          else if(anvin.equalsIgnoreCase("-")) {
              ans = nr1 - nr2;
          }
          else if(anvin.equalsIgnoreCase("*")) {
              ans = nr1 * nr2;
          }
          else if(anvin.equalsIgnoreCase("/")) {
              ans = nr1 / nr2;
              System.out.println(ans);
          }
          if(anvin.equalsIgnoreCase("yes")) {
              return;
          }
      }
  }
  </code></pre>