title: Do while loop with try catch
body: <pre><code>public static void main(String[] args) throws IOException {
  
      InputStreamReader isr = new InputStreamReader(System.in);
      BufferedReader br = new BufferedReader(isr);
  
      boolean format = false;
      int grades = 0;
  
      do {
          System.out.println("Enter course mark (0-100): ");
  
          try {
              String input = br.readLine();
              grades = Integer.parseInt(input);
  
          } catch (NumberFormatException | IOException e) {
              System.out.println("Error number format!");
          }
  
      } while (!format);
  
      if (grades &gt; 100 || grades &lt; 100) {
          System.out.println("Please enter within the range (0-100)");
      }
  
      System.out.println("Your grades is " + grades);
  
  }
  </code></pre>
  
  <p>What have i done wrong here i am trying to achieve this</p>
  
  <blockquote>
    <p>Enter course mark (0-100): qwerty<br>
    Bad input data type.<br>
    Enter course mark (0-100): -12<br>
    Input out of [0, 100] range!<br>
    Enter course mark (0-100): 24<br>
    Your grades is 24</p>
  </blockquote>