title: Breaking out of while loop in java
body: <p>I don't really see why it's not breaking out of the loop. Here is my program:</p>
  
  <pre><code>public static void main(String[] args) {
  
      Scanner input = new Scanner (System.in);
  
      double tution, rate, r, t, realpay, multiply, start;
      start = 0;
  
      while(start != -1)
      {
          System.out.print("Press 1 to start, -1 to end: ");
          start = input.nextDouble();
  
          System.out.print("Please enter the current tution fee for the year: ");
          tution = input.nextDouble();
  
          System.out.print("Enter in the amount of interest: ");
          rate = input.nextDouble();
  
          r = 1 + rate;
  
          System.out.print("Please enter the number of years: ");
          t = input.nextDouble();
          multiply = Math.pow(r,t);
          realpay = tution * multiply;
  
          System.out.println("the cost of your tution fee: " + realpay);
  
          if (start == -1)
          {
              break;
          }
      }
  }
  </code></pre>
  
  <p>Could you tell me what is wrong with it?</p>