title: Loop doesn't behave the way I expect
body: <p>The code I have written compiles but does not produce the output I was expecting. It ends before I have put in all of my input data and doesn't give me the correct output. Any idea where the mistake(s) is?</p>
  
  <p>Here's main program:</p>
  
  <pre><code>public static void main(String[]args)
  {
      Scanner keyboard = new Scanner(System.in);
      String coinFlip;
      int tossNumber, numberOfHeads, numberOfTails;
      float percHeads, percTails;
      tossNumber = 1;
      numberOfHeads = 0;
      numberOfTails = 0;
  
      while(tossNumber &lt;= 8)
      {
          System.out.println("Please toss your coin and enter the side    showing.");
          System.out.println("h = heads, t = tails");
          coinFlip = keyboard.next();
  
          if(coinFlip.equals("h") || coinFlip.equals("t"))
          {
              if(coinFlip.equals("h"))
              {
                  System.out.println("Thank you! Please toss your coin again.");
                  tossNumber = tossNumber + 1;
                  numberOfHeads = numberOfHeads + 1;
              }
              else
  
                  System.out.println("Thank you! Please toss your coin again");
                  tossNumber = tossNumber + 1;
                  numberOfTails = numberOfTails + 1;
  
          }
          else
              System.out.println("Please enter a \"h\" or \"t\".");
      }
  </code></pre>