title: simple Java calculator - while loop until answer is 0
body: <p>Really new to java and having some trouble with this assignment. The assignment was to: </p>
  
  <blockquote>
    <p>Write a simple calculator program that prints a welcome
    message, accepts a simple arithmetic expression from the user, and
    performs the requested operation. Your  program should repeat this
    until both operands are 0 and then exit.</p>
  </blockquote>
  
  <p>It's running fine but I'm not sure how to get a handle on the While Loop so that the calculator will continue until the answer is 0. Sorry if this is a really basic question. Any help would be appreciated.</p>
  
  <pre><code>import java.util.Scanner;
  
  class Calculator{
      public static void main(String[] args)
      {
          System.out.println("Welcome to CSC 210 Calculator by Bob the Builder!");
          System.out.println("Enter an integer operation: ");
  
      Scanner input = new Scanner(System.in);
  
          int x = input.nextInt();
          String operation= input.next();
          int y = input.nextInt();
  
              while(x + y != 0){
  
          if(operation.equals("+")){
              System.out.println(x + y);
          }
  
          else if(operation.equals("-")){
              System.out.println(x - y);
          }
  
          else if(operation.equals("*")){
              System.out.println(x * y);
          }   
  
          else if(operation.equals("/")){
              System.out.println(x / y);
          }
  
          else if(operation.equals("%")){
              System.out.println(x % y + y);
          }
  
  
          else {
              System.out.println("Operation is invalid.");
          }
  
  
                  System.out.println("Enter an integer operation: ");
                  if(x + y != 0);
                                  break;
          }
  
      }
  }
  </code></pre>