title: Sentinel Value in Java
body: <p>I'm just starting out with java, and for my intro class must create loops with a sentinel value of 0 to convert entered USD to GBP. There is some run-time error and it appears I've created in infinite loop. Can anyone help? Thanks in advance!</p>
  
  <pre><code>import java.util.Scanner;
  /**
   * Prompts user for today's conversion of USD to GBP
   * Then prompts user for USD value, which will inform user of GBP
   * Prompting loop for other USD values, util sentinel value of (0) is encountered
   * hint: while loop shouldnt include prompt for exchange rate. When user enteres 0, program will print terminating "goodbye" message and end
   */
  public class AP6_DollarToPound
  {
     public static void main(String[] args)
     {
         Scanner in = new Scanner(System.in);
  
         double amount = 0;
         int rate = in.nextInt();
         int value = in.nextInt();
  
         System.out.println("Enter today's US Dollar to British Pound Sterling exchange rate: ");
         System.out.println("Enter a value in US Dollars: ");
  
         while (value != 0);
         {
             value = in.nextInt();
             if (value != 0)
             {
                 amount = rate * value;
                 System.out.println("Value in GBP is: " + value);
              }
              else
              {
                  System.out.println("Goodbye!");
              }
          }
          }
      }
  </code></pre>