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
PLZZ HELP
kap26 [50]

Answer:

Explanation:

Keep in mind a lossy algorithm will lose information while a lossless algorithm maintains all your original information.

Therefore:

A. False, a lossy algorithm will not allow perfect reconstruction.

B. True, if you don't care about keeping all your information it's easier to compress.

C. False, you can use a lossless algorithm for anything.

D. False, the point of lossless is that you keep all information.

4 0
2 years ago
What is mendix about?
fenix001 [56]

Answer:

Mendix is another word for appendix.

Explanation:

3 0
3 years ago
When individuals are purchasing a computer, they sometimes might get the most expensive computer they can afford. Why might this
timama [110]

Answer:

Expensive is not always better

Explanation:

So I build 2 computers ok

Computer 1: Price 1,999$

<u>Whats Included:</u>

  • Antivirus
  • Anti-Over-Heat
  • Windows 8 Operating Software
  • Free VPN (For Life)
  • 24/7 Support
  • 1 year warranty
  • 3/5 Star Reviews | Main Review Type: Parts Breaking Inside

Computer 2: Price 799$

<u>Whats Included:</u>

  • Anti Virus
  • Anti Over-Heat
  • 1 Year Warranty
  • Windows 10 Operating Software
  • 24/7 Support
  • 10 Year Warranty
  • 4/5 Star Reviews | Main Review Type: Runs Smooth
  • No VPN

<h2>So Computer 2 Has better reviews and a 10 year warranty over computer 1's 1 year warranty</h2>
8 0
2 years ago
A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
denis-greek [22]

Answer:

The computer will store 8.05 *10^10 bytes of information.

Explanation:

This is the same as saying that the computer will now have 80.51 Gigabytes ( 1gb = 1.000.000.000 bytes) of storage. In this case, the number is represented in its decimal form, and the previous one is displayed in Scientific Notation.

8 0
2 years ago
What is a digital certificate? Select one: a. It is a means of establishing the validity of an offer from a person, entity, web
a_sh-v [17]

Option D is the answer because Digital Certificate is an entity that generates electronic and distributes them upon proving their identity sufficiently. In early days there was issues with people using the certificates that were not even issued by the organizations. Today it's a cryptographic technique which uses digital signatures and gives users a digital certificate that can be authenticated anytime online by any organization and is unique for every user having it.

Option A cannot be the answer because it has nothing to do with the identity of person but rather it is for specific fields.

Option B is not answer because it has no key and score matter to do with it.

Option C Web transactions has nothing to do with the certificates.

8 0
3 years ago
Other questions:
  • To extend the bottom border of a hyperlink across the complete width of a navigation list, change the ____ property of each hype
    9·1 answer
  • If you have a charger that’s not from Apple, then could that damaged your iPhone or not?
    5·1 answer
  • Kaitlin likes a particular design theme, but she is not sure about every single color for bullets, backgrounds, etc found in the
    5·2 answers
  • A project manager type a document and print it he is using
    14·1 answer
  • What is a orogram to block access to websites
    15·1 answer
  • What does not stand for​
    15·2 answers
  • Match the desired outcome to the appropriate action.
    6·1 answer
  • I only put one answer and didn’t specify what it answered
    14·2 answers
  • Need help finding the totals and with the empty spots
    9·1 answer
  • Select the correct answer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!