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
Travka [436]
3 years ago
12

When a statement within a try block causes an exception, the remaining statements in the try block Select one: a. are executed a

fter the statements in the catch block b. are executed before the statements in the catch block c. aren't executed
Computers and Technology
1 answer:
NikAS [45]3 years ago
3 0

In C++, 'Try block' comprises of a group of statements in which there is a probability of an exception to take place.

C). The statements that would be left in the try block in case a particular statement leads to an exception 'can't be executed.'

  • In case an exception takes place, the left statements in the try block fail to function.
  • This is the primary reason for which a catch block immediately succeeds a try block in order to deal with the exception and help close that code to allow the statements to work.
  • Thus, <u>option C</u> is the correct answer.

Learn more about 'Try block' here:

brainly.com/question/14186450

You might be interested in
1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
PolarNik [594]

Answer:

A

Explanation:

Because

7 0
3 years ago
Modify the program you wrote for Chapter 6 Exercise 6 so it handles the following
Basile [38]

Answer:

#try except

try:

   #opening the file

   read_file = open('numbers.txt', 'r')

   #Store the numbers in the variable file_numbers.

   file_numbers = read_file.read()

   #close the file

   read_file.close()

   #Split the number of files in list_values.

   list_values = file_numbers.split()

   #how many numbers are there

   list_length = len(list_values)

   try:

       #loop it up

       for i in range(list_length):

           list_values[i] = float(list_values[i])

       #Add up all the numbers, put into list_sum

       List_sum = sum(list_values)

       #heres how we average it

       Average_value = (List_sum)/list_length

       #print

       print(Average_value)

   except ValueError:

       print( "File must have only numbers. Try again." )

   #handles IOError exceptions

except IOError:

   #Display statement

   print("Trouble opening file. Try again.")

Explanation:

The python program uses the try-except exception handling method to catch errors in the code. The IOError is used for catching input and output errors in the program like file handling while the ValueError keyword in the except statement is used to catch data type errors from a return statement, calculation or user input.

6 0
3 years ago
Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the method in a pr
yawa3891 [41]

Answer:

The program in Java is as follows:

import java.util.*;

import java.lang.Math;

public class Main{

public static int maxMagnitude(int num1, int num2){

    int mag = num2;

    if(Math.abs(num1) > Math.abs(num2)){

        mag = num1;

    }

    return mag;

}

public static void main(String[] args) {

 int num1, num2;

 Scanner input = new Scanner(System.in);

 System.out.print("Enter two integers: ");

 num1 = input.nextInt();

 num2 = input.nextInt();

 System.out.println(maxMagnitude(num1,num2));

}

}

Explanation:

The method begins here

public static int maxMagnitude(int num1, int num2){

This initializes the highest magnitude to num2

    int mag = num2;

If the magnitude of num1 is greater than that of num2

    if(Math.abs(num1) > Math.abs(num2)){

mag is set to num1

        mag = num1;

    }

This returns mag

    return mag;

}

The main  method begins here

public static void main(String[] args) {

This declares num1 and num2 as integer

 int num1, num2;

 Scanner input = new Scanner(System.in);

This prompts the user for two integers

 System.out.print("Enter two integers: ");

This gets input for the first integer

 num1 = input.nextInt();

This gets input for the second integer

 num2 = input.nextInt();

This calls the maxMagnitude method and prints the number with the highest magnitude

 System.out.println(maxMagnitude(num1,num2));

}

3 0
3 years ago
What is the best overall approach to education and career development for IT professionals?
LuckyWell [14K]

Professional development is learning to earn or maintain professional credentials such as academic degrees to formal coursework, conferences and informal learning opportunities situated in practice. It has been described as intensive and collaborative, ideally incorporating an evaluative stage.[1] There are a variety of approaches to professional development, including consultation, coaching, communities of practice, lesson study, mentoring, reflective supervision and technical assistance.[2]


5 0
3 years ago
Digital and analog audio recordings have pros and cons. Do you think the pros of digital recordings outweigh the cons and theref
Debora [2.8K]

Digital vs Analog Audio is completely personal preference and there is no clear winner on which is better.

But there are some pros and cons about both, Analog sometimes distorts when playing and can be easily scratched and ruins the grooves. Analog is believed to be the true representation of the sound when it was recorded. Digital is not the actual recording of the sound, it's actually a combination of binary code. It is also sometimes mixed or remastered in Digital and sounds a bit different to make it sound better. It also depends on the system you are listening it from. You could have a horrible Digital system its playing through and an amazing Analog system playing, of course the Analog system will sound better in that case. Some believe that Digital is on par to overtake Analog in the "true picture of sound" category but some also say Analog will forever be the best at playing sound and Digital will always be the alternative.

But, in the end it's all personal preference and the pros and cons don't overweigh to make one better than the other.

6 0
3 years ago
Other questions:
  • Respond to the following in a paragraph of no less than 125 words. What is the purpose of netiquette guidelines?
    10·1 answer
  • Word offers a multitude of picture formatting options that allow you to flip, rotate, and make many other adjustments to inserte
    15·1 answer
  • Storing a value in a variable<br> Exponent<br> Variable<br> Assignment<br> Operator
    13·1 answer
  • What is the main characteristic of a Peer-to-Peer (P2P) network?
    8·1 answer
  • "Managers and department heads across the nation strategize on a weekly, if not daily, basis. For the past three quarters, telep
    6·1 answer
  • Consider the following code segment. for (int a = 0; a &lt; 10; a++) { for (int b = 10; b &gt; a; b--) { System.out.print("#");
    6·1 answer
  • Which system utility can you use to troubleshoot a computer that's slow to start by enabling or disabling startup programs?
    7·2 answers
  • Diane is receiving a lot of unwanted e-mail. What steps can she take to reduce the amount of e-mail she receives?
    12·1 answer
  • What is a GUI?
    11·1 answer
  • Briefly describe the working of computer processing system?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!