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
Reil [10]
3 years ago
12

How can an exception be explicitly raised in C++? How are exceptions bound to handlers in C++?

Computers and Technology
1 answer:
xenn [34]3 years ago
4 0

Answer:

Exceptions are raised using throw statement in c++.

Explanation:

Try block is used to keep the statements which we felt that they will raise an exception. Catch block is used to catch the exception which is thrown by the try block.

#include<iostream.h>

void main(){

int x,y,z;

try{

cout<"enter 2 numbers";

cin>>x>>y;

if(y==0)

throw y;

z=x/y;

}

catch(int x){

cout<<"exception caught";

}

}

You might be interested in
Consider the following methods.public void modParams(int[] x, int[] y, String[] s){x[1] = 5;y = x;s[1] = new String("five");s =
skad [1K]
I am not too happy to be a good man in my world but he is made me very very much and he is made me very very much and he is very much very good to him very much and he is very much very good to you very good and very much to be able for my kids with a little more money will not go back and you can do the greatest if he can be very much and you have no problem and then we do all the way that we are not the right answer but you have a question to do and you don’t have the right right answer the answer right back and he will not be very good I am very good and he is very very bad
5 0
3 years ago
Now suppose there are four links between source and destination (three routers in the path between source and destination). Each
pychu [463]

Answer:

12.1 seconds

Explanation:

Step 1:

Assuming the following data :

N: Size of packet = 30 Mb

T: Transmission rate =  10 Mbps

C: Speed of light in copper = 2 * 10^8 m/s

L: Length of link 5000 km

Step 2:

Calculation of the Transmission delay and the Propagation Delay

Transmission delay = \frac{packet size}{bandwidth} = \frac{30Mb}{10Mbps} = 3s

Propagation delay = \frac{length of link}{speed of light in copper} = \frac{5000*10^3}{2 * 10^8} = 0.025s

Step 3:

Calculation of the end-to -end delay

The end-to-end delay = 4*(Transmission Delay+Propagation Delay) = 4*(3+0.025) = 12.1 seconds

6 0
4 years ago
How many times does the following loop execute?int upperCaseLetters = 0;String str = "abcdEfghI";boolean found = false;for (int
damaskus [11]

Answer:

Five times

Explanation:

Given the codes as follows:

  1.        int upperCaseLetters = 0;
  2.        String str = "abcdEfghI";
  3.        boolean found = false;
  4.        for (int i = 0; i < str.length() && !found; i++)
  5.        {
  6.            char ch = str.charAt(i);
  7.            if (Character.isUpperCase(ch))
  8.            {
  9.                found = true;
  10.            }
  11.        }

The for loop will stop when the first uppercase letter is found in the str. This condition is set in the for loop condition ( i < str.length() && !found)

Since the the first upper case letter is the fifth character in the given str, the for loop will run for five rounds. In the fifth round the condition in the if statement (Line 9) will be evaluated to true and then set the true value to found variable (Line 11). This will terminate the loop in the next iteration.

7 0
3 years ago
PLEASE HELP ME!!!!!! ITS FOR 100 POINTS AND BRAINLIEST!!!!!!!! NO ONE EVER WANTS TO ANSWER MY QUESTION!!! I JUST NEED SOMEONE TO
Veronika [31]

Answer: my suggestion is to ask a teacher and do research like look up the best shoe companies and things like that

Explanation:

6 0
3 years ago
How do we make a acount
IRISSAK [1]
Press sign up and put your information in there. Then it should automatically make your profile.
8 0
3 years ago
Read 2 more answers
Other questions:
  • --- is a set of applications that manages the activities and resources of a computer.
    12·1 answer
  • What is the definition of legal intrusion
    14·1 answer
  • Jimmy is running out of desk space. He keeps three computers on his desk. The three computers can’t be moved, and they need to b
    5·2 answers
  • how does modern information technology has affected society ?? Need help on how it has affected society
    10·1 answer
  • Given two variables , first_place_winner and second_place_winner, write some code that swaps their associated values. use any ad
    12·1 answer
  • Which of the following is the most appropriate unit to describe the rate at which data is transferred using the internet?
    6·2 answers
  • Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
    5·1 answer
  • Which scenario is best for an online discussion group?
    5·1 answer
  • Awnser pls I will appreciate it
    9·1 answer
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!