title: How can I correct this program to prevent it from throwing java.lang.NumberFormatException?
body: <p>So this is the program I wrote for School:</p>
  
  <pre><code>import java.io.*;
  public class p35{
  public static void main()throws IOException
  {
      InputStreamReader isr = new InputStreamReader(System.in);
      BufferedReader br = new BufferedReader(isr);
      System.out.println("Enter c for circle,r for rectangle and t for triangle");
  
      char a = (char)br.read();
      switch(a)
      {
          case 'c': System.out.println("Enter radius");
                    String r = br.readLine();
                    int rad = Integer.parseInt(r);
                    System.out.println("area of circle is:"+(22/7)*(rad*rad));
                    break;
          case 'r': System.out.println("Enter length");
                    String l = br.readLine();
                    int len = Integer.parseInt(l);
  
                    System.out.println("Enter breadth");
                    String bd = br.readLine();
                    int breadth = Integer.parseInt(bd);
                    System.out.println("area of rectangle is: "+len*breadth);
                    break;
          case 't': System.out.println("Enter base");
                    String b = br.readLine();
                    int bas = Integer.parseInt(b);
  
                    System.out.println("Enter height");
                    String h = br.readLine();
                    int htg = Integer.parseInt(h);
                    System.out.println("area of triangle is: "+(1/2)*bas*htg);
                    break;
          }
      }
  }
  </code></pre>
  
  <p>It doesn't seem to work and throws java.lang.NumberFormatException.
  Can someone help me correct it?
  p.s I am not allowed to use exception handling so could you please try to help me without using that? 
  Thanks</p>