title: Checking if a letter == a specified letter in Java
body: <p>I am trying to perform a check to make sure the letter typed by the user is between A and E. I have tried several different ways, but nothing seems to work. Any help would be appreciated. The main problem is, it only checks once. After it tells me I need to enter a letter between A and E, and I put g, it allows the program to continue running afterwards.</p>
  
  <pre><code> System.out.println("Please enter a letter indicating your tax category: A is no tax deduction, B is 10% of gross pay, \nC is 20% of gross pay, D is 29% of gross pay, E is 35% of gross pay");
   //use ASCII of letters to compare
  int A_ASCII = (int)'A';
  int E_ASCII = (int)'E';
  int ASCIIletter = 0;
  // ask user for letter
  letter = in.next().charAt(0);
  // convert letter to uppercase and find ASCII value
  if(Character.isLetter(letter)){ 
   letter = Character.toUpperCase(letter);
   ASCIIletter = (int) letter;
  while (ASCIIletter&gt;=A_ASCII&amp;&amp;ASCIIletter&lt;=E_ASCII) {
  if(ASCIIletter&gt;=A_ASCII&amp;&amp;ASCIIletter&lt;=E_ASCII){ 
  if (ASCIIletter=='A'||ASCIIletter=='a'){
    letter = letter;
    gross = gross;
  }
  else if (ASCIIletter=='B'||ASCIIletter=='b'){
   letter = letter;
   deduct = (gross*0.1);
   tax = gross - deduct;  
  }
   else if (ASCIIletter=='C'||ASCIIletter=='c'){
   letter = letter;
   deduct = (gross*0.2);
   tax = gross - deduct;
  }
   else if (ASCIIletter=='D'||ASCIIletter=='d'){
   letter = letter;
   deduct = (gross*0.29);
   tax = gross - deduct;
  } 
  else if (ASCIIletter=='E'||ASCIIletter=='e'){
  letter = letter;
  deduct = (gross*0.35);
  tax = gross - deduct;
  }
  }
   else { 
  System.out.println("You must enter a letter between A and E.");
  letter = in.next().charAt(0);
  }
  }
  </code></pre>