title: while loop never completes
body: <p>The objective of my program is to:</p>
  
  <blockquote>
    <p>Write an application to pre-sell a limited number of private concert tickets. Each buyer can buy as many as 6 tickets. No more than 75 tickets can be sold. Implement a program that prompts the user for the desired number of tickets and then displays the number of remaining tickets.  Use a while loop in your implementation. Repeat until all tickets have been sold, and then display the total number of buyers.</p>
  </blockquote>
  
  <p>I seem to be having a problem with my loop closing, because even when the loop variable gets to its condition limit it still prompts for the number of tickets. Any idea why?</p>
  
  <pre><code>import java.util.Scanner;
  
  public class TicketCounterHorn {
  
    public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
  
      int ticketsToBuy;
      int totalTickets =75;
      int buyers = 0;
      int ticketMax = 6;
  
      while (totalTickets &gt;= 0) {
          System.out.print("How many tickets would you like to purchase: ");
          ticketsToBuy = in.nextInt();
  
          if (ticketsToBuy &lt;= ticketMax &amp;&amp; ticketsToBuy &gt; 0) {
  
              if (ticketsToBuy &lt; totalTickets) {
                  totalTickets = totalTickets - ticketsToBuy;
                  buyers++;
                  System.out.println(ticketsToBuy);
                  System.out.println(buyers);
                  System.out.println(totalTickets);
              }
          }
      }
  
      System.out.println("the total number of buyers is: " + buyers);
    }
  }
  </code></pre>