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
VikaD [51]
3 years ago
8

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
Computers and Technology
1 answer:
anzhelika [568]3 years ago
4 0

Answer:

d) either e1 or e5

Explanation:

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.

You might be interested in
A JOB LEADS SOURCE LIST is used to help record all of the job leads you can find. It includes contact information and a plan for
Amiraneli [1.4K]

Answer:t

Explanation:

8 0
2 years ago
Converting raw data into a more meaningful form is called:
White raven [17]
Converting raw data into a more meaningful form is called: processing
8 0
3 years ago
Use the variables k, d, and s so that they can read three different values from standard input--an integer, a double, and a stri
Nat2105 [25]

Answer:

The c++ program to implement the given scenario is shown below.

#include <iostream>

using namespace std;

int main() {

   // variables declared as mentioned

   int k;

   double d;

   string s;

   cout << " Enter an integer value, a double value, a string value in the mentioned order " << endl;

   cin >> k >> d >> s;

   // variables printed in reverse order

   cout << " Reverse order " << endl;

   cout << s << " " << d << " " << k << endl;

   // variables printed in original order

   cout << " Original order " << endl;

   cout << k << " " << d << " " << s << endl;

   return 0;

}

OUTPUT

Enter an integer value, a double value, a string value in the mentioned order  

12 45.67 brainly

Reverse order  

brainly 45.67 12

Original order  

12 45.67 brainly

Explanation:

1. All the variables are declared as mentioned in the question.

int k;

   double d;

   string s;

2. The user is prompted to enter values for integer, double and string variables respectively. The input is accepted in the order mentioned above.

cin >> k >> d >> s;

3. The input is accepted in a single line since this is mentioned in the scenario that variables should be printed in the order in which they are read.

4. These variables are displayed to the standard output in reverse order – string, double, integer. The variables are displayed with exactly one space in between them.

cout << s << " " << d << " " << k << endl;

5. Then, variables are displayed in the original order – integer, double, string. The variables are displayed with exactly one space in between them.

cout << k << " " << d << " " << s << endl;

7 0
3 years ago
How is binary used in pixels and in sound?
FinnZ [79.3K]

Answer:

Sound needs to be converted into binary for computers to be able to process it. To do this, sound is captured - usually by a microphone - and then converted into a digital signal. The samples can then be converted to binary. They will be recorded to the nearest whole number.

Explanation:

is this it?

3 0
3 years ago
Read 2 more answers
West Point Bridge Designer | Does anyone know a way to make this bridge cost less?
e-lub [12.9K]
Make the zig zag part more spaced out
4 0
3 years ago
Other questions:
  • In the ____________________ technique, the virus is divided into several parts and the parts are placed at random positions thro
    7·1 answer
  • The right headlight does not function on either high or low beam. Technician A says this could be caused by an open ground on th
    12·1 answer
  • To answer the research question "How am I going to find the information I need on the tople?" the best thing Georgia should
    15·1 answer
  • Logan has developed an excellent presentation with interesting content. He received great feedback on the evaluation
    10·1 answer
  • GUYS THERE IS A HACKER IN BRAINLY PLEASE DONT PRESS ON THE WEBSITE THEY WILL HACK YOU.
    9·2 answers
  • In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set M
    11·1 answer
  • How does social network use message to entertain?
    14·1 answer
  • 1k bits equals to how many bits
    12·1 answer
  • What are basic types of touch screen
    15·2 answers
  • A monitor is an output device. Which of the following is not a type of monitor? *
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!