subject

Consider the code below. Note that the catch statements in the code are not implemented, but you will 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 question (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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:40
How do i get the most points, without any effort?
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
In a heat transfer course, we can derive the equation for the temperature distribution in a flat rectangular plate. in this example, we will look at a plate at steadystate with three sides being held at t1, and one side held at t2. the temperature for any location on the plate, t(x,y), can be calculated by where create a function (prob3_5) that will take inputs of vectors x and y in feet, scalar n, scalars l and w in feet and scalars t1 and t2 in degrees fahrenheit. it will output a matrix t which is the temperature of each x and y locations. t will have the number of columns equal to the number of elements in x and rows equal to the number of elements in y. though this can be done without loops (perhaps more efficiently), your program must use a nested loop.
Answers: 2
question
Computers and Technology, 25.06.2019 02:30
What are the charges for invasion of privacy on computers
Answers: 1
question
Computers and Technology, 25.06.2019 04:50
Your program should prompt the user for the dimensions of the two squares matrices, making sure that the user input is greater than or equal to 4.[ yes, an example would be a4x4matrix]2.if the above is not met, prompt the user for a new value.3.now generate random integernumbers to fill both matrices.4.display these two matrices on the screen.5.multiply the two matrices and display the result on the scre
Answers: 2
You know the right answer?
Consider the code below. Note that the catch statements in the code are not implemented, but you wil...
Questions
question
Mathematics, 14.12.2020 07:20
question
English, 14.12.2020 07:20
question
Social Studies, 14.12.2020 07:20
question
Mathematics, 14.12.2020 07:20
question
Mathematics, 14.12.2020 07:20
Questions on the website: 13722360