1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivan
3 years ago
11

Consider the code below. Note that the catch statements in the code are not implemented, but you will not need those details. As

sume 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
Computers and Technology
1 answer:
Dmitriy789 [7]3 years ago
6 0

Missing Part of Question

An exception raised by the instruction in i3 would be caught by the catch statement labeled?

Answer:

e3 and e4.

Explanation:

The instruction tag i3 points to the following code segment

a[++i] = (double) (1 / x); // i3

The code segment above performs arithmetic operation (double)(1/x)

And then assigns the value of the arithmetic operations to an array element a[++I]

It's possible to have one or both of the following two exceptions.

1. Error in Arithmetic Operation

2. Index of Array out of bound

These are both represented in exception tags e3 and e4

catch (ArithmeticException ex) {...} // e3

catch (ArrayIndexOutOfBounds ex) {...} // e4

Exception e3 can arise when the program try to carry out invalid arithmetic operation.

For instance, 1/0 or 0/0.

This will lead to ArithmeticException to be thrown

Exception e4 can arise when the program tries to assign values to an index that's not in an array.

Say, the total index in a given array a is 5.

The index of this array is 0 to 4; i.e. a[0] to a[4]

The moment the program tries to assign values to array element other than the ones I listed above (e.g a[5]) ArrayIndexOutOfBounds exception will be thrown

You might be interested in
. Mercury, Venus, Earth, and Mars are the closest planets to the Sun
DIA [1.3K]

Answer:

<h3>True</h3><h2>Mercury  is the nearest</h2>

Explanation:

I hope this helps

4 0
3 years ago
Identify a logical operation (along
tankabanditka [31]

Answer: Provided in the explanation section

Explanation:

The Question says;

Identify a logical operation (along

with a corresponding mask) that, when

applied to an input string of 8 bits,

produces an output string of all 0s if and

only if the input string is 10000001.​

The Answer (Explanation):

XOR, exclusive OR only gives 1 when both the bits are different.

So, if we want to have all 0s, and the for input only 10000001, then we have only one operation which satisfies this condition - XOR 10000001. AND

with 00000000 would also give 0,

but it would give 0 with all the inputs, not just 10000001.

Cheers i hope this helped !!

3 0
3 years ago
Which term is used to define the wires on a motherboard that move data from one part of a computer to another?
mafiozo [28]
The answer to this question is the term bus. The term bus in computers is a communication system that transfers data and information in the computer to another computer. The bus are parallel wires that can be either optical or fiber that are connected in multiple switched hubs.
4 0
3 years ago
Which location on the ribbon contains the commands for adding a table to a document?
Maksim231197 [3]

Adding a table to a document can be done in Microsoft Word using the insert ribbon, the insert ribbon are mostly used for adding options to a document.

  • The insert ribbon is a multi functional ribbon which has up to about 10 different useful groups for adding elements to a document.

  • Some of the groups on the insert ribbon include ; Pages, Text, Header & Footer, Tables, illustrations, Links, Media and so on.

  • The Table group in the insert ribbon allows different table adding options such as inserting an already existing table, drawing a new table or importing an excel table.

Therefore, adding a table to a document is performed from the insert ribbon in Microsoft Word.

Learn more:brainly.com/question/21842366?referrer=searchResults

4 0
2 years ago
Creating an application for an ice cream shop. Create an interface named Flavor. Create three subclasses Lemon, Mint, and Chocol
Tpy6a [65]

Answer:

I don't know for sure what the answer is but I hope you can find someone that can give you the answer sorry!

Explanation:

6 0
2 years ago
Other questions:
  • Laura is confused with the spelling of the word pronunciation. She types the word pronunciation. Which feature of the auto corre
    8·2 answers
  • How to get out of compatibility mode in word?
    15·1 answer
  • The word software is interchangeable with what word
    8·1 answer
  • What is the language of computers?
    9·1 answer
  • Write a Python 3 program to read from a .csv file containing rates from power companies. Your program should determine the avera
    13·1 answer
  • Please help with my Python code - Functions
    6·1 answer
  • What blockchain implementation resulted from bitcoin’s rejection of a recommendation to enhance its scripting language support?
    9·1 answer
  • A company is completing research and development for software which it is planning to produce in approximately 2 years time. Whi
    7·1 answer
  • Give three examples of NON-TRADITIONAL web authoring tools<br> 3 pour
    14·1 answer
  • 1. Encrypt this binary string into cipher text: 110000. Include in your answer the formula the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!