Use the code below to answer the following questions. Note that the catch statements in the code are not implemented, but you wi
ll not need those details. Assume filename is a String, x is an int, a is a double array and i is an int. Use the comments i1, i2, i3, e1, e2, e3, e4, e5 to answer the questions (i for instruction, e for exception handler) try { BufferedReader infile = new BufferedReader(new FileReader(filename)); // i1
int x = Integer.parseInt(infile.readLine( )); // i2
a[++i] = (double) (1 / x); // i3
}
catch (FileNotFoundException ex) {...} // e1
catch (NumberFormatException ex) {...} // e2
catch (ArithmeticException ex) {...} // e3
catch (ArrayIndexOutOfBounds ex) {...} // e4
catch (IOException ex) {...} // e5
An exception raised by the instruction in i1 would be caught by the catch statement labeled:
a) e1
b) e2
c) e5
d) either e1 or e5
e) either e1, e4, or e5
Here, the instruction i1 goes ahead in trying to open the given file through an input stream buffer reader. If the given file name is wrong, it will indicate that an e1 file is not found or if any other IO errors due to invalid stream, no disc in drive e5 IO exception will be drawn.
Nope. You're on your own to find them and fix them. This why testing is so important, otherwise they won't show up until the customer finds them and that's embarrasing.