How do I use Error handling in Java : <p>This code works if you put a number 0-100 and if you but something out of that range. How do i get it to accept things like letters or words and say please enter a grade between 0 and 100? My code is: </p>

<pre><code> import java.util.Scanner;
 public class LetterGrade {
    public static void main(String[] args) {
    Scanner grades = new Scanner(System.in);
    int grade = 0;
    String LetterGrade = "";
    System.out.print("Enter your test grades: ");
    grade = grades.nextInt();

    if (grade &gt; 100 || grade &lt; 0) {
        System.out.println("Enter the percentage from 0 - 100");
}

while (grade &gt; 100 || grade &lt; 0) {

    System.out.print("Enter your test grades: ");
    grade = grades.nextInt();
    if (grade &gt; 100 || grade &lt; 0) {
        System.out.println("Enter the precentage from 0 - 100");
    }
}
//Define the number Grade to equal a Letter
if (grade &lt;= 100 &amp;&amp; grade &gt;= 97)
    LetterGrade = "A+";
if (grade &lt;= 96 &amp;&amp; grade &gt;= 93)
    LetterGrade = "A";
if (grade &lt;= 92 &amp;&amp; grade &gt;= 90)
    LetterGrade = "A-";
if (grade &lt;= 89 &amp;&amp; grade &gt;= 87)
    LetterGrade = "B+";
if (grade &lt;= 86 &amp;&amp; grade &gt;= 83)
    LetterGrade = "B";
if (grade &lt;= 82 &amp;&amp; grade &gt;= 80)
    LetterGrade = "B-";
if (grade &lt;= 77 &amp;&amp; grade &gt;= 74)
    LetterGrade = "C+";
if (grade &lt;= 73 &amp;&amp; grade &gt;= 73)
    LetterGrade = "C";
if (grade &lt;= 72 &amp;&amp; grade &gt;= 70)
    LetterGrade = "C-";
if (grade &lt;= 69 &amp;&amp; grade &gt;= 67)
    LetterGrade = "D+";
if  (grade &lt;= 66 &amp;&amp; grade &gt;= 65)
    LetterGrade = "D";
if (grade &lt;= 64 &amp;&amp; grade &gt;= 60)
    LetterGrade = "D-";
if (grade &lt;= 59 &amp;&amp; grade &gt;= 0)
    LetterGrade = "F";

System.out.println("Your test grade of " + grade + " is a letter grade of " + LetterGrade);

}
</code></pre>

<p>}</p>
