title: My sentinel controlled while loop is not working
body: <p>I can't get the while loop to work.  The Program prompt user whether (s)he wants to continue, enter 0 toquit or any other integer to continue. If the user wants to c
  ontinue, the program will loop back to themenu, otherwise, it will exit. Thus, you should have a sentinel-controlled loop that will end when a 0 is entered</p>
  
  <pre><code>import java.util.Scanner;
  
  public class AdoptAPet
  {
    public static void main(String[] args)
    {  
      Scanner input = new Scanner(System.in);
      int gender = 0;
  
      double costAdoption = 0.0;
      double costGenderSelect = 0.0;
      double costAnyGender = 0.0;
      double costProcessing = 0.0;
      double total = 0.0;
      int genderCounter = 0;
  
      System.out.println("Choose from the following options: 1 for male, 2 for female, 3 for any");
  
       while(gender != 0);//begin sentinel controlled while loop
      {
      System.out.print("Please choose the gender of the cat you wish to purchase:");
      gender = input.nextInt();
  
     if(gender &lt; 0)
     {
      System.out.println("INVALID CHOICE! ");
  
      System.out.print("enter 0 to quit: 0 or enter any other nunber to continue:");
      gender = input.nextInt();
     }
  
      if(gender == 1)
      { 
      costAdoption = 9.50;
      costAdoption += costProcessing + 2.00;
      total += costAdoption;
  
      System.out.printf("Your Choice is: " );
      System.out.printf("male and the total is $%.2f", total);
      }
  
      if(gender == 2)
      {
      costGenderSelect = 11.50;
      costGenderSelect += costProcessing + 2.00;
      total += costGenderSelect;
  
      System.out.printf("Your Choice is: " );
      System.out.printf("female and the total is $%.2f", total);
      }
  
      if(gender == 3)
      {
      costAnyGender = 9.50;
      costAnyGender += costProcessing + 2.00;
      total += costAnyGender;
  
      System.out.printf("Your Choice is: " );
      System.out.printf("Any gender and the total is $%.2f", total);
      }
  
      }
  
    }
  }
  </code></pre>