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
Dennis_Churaev [7]
4 years ago
9

Consider the following C code: double balance; try { cout << "Enter the balance: "; cin >> balance; cout << en

dl; if (balance < 1000.00) throw balance; cout << "Leaving the try block." << endl; } catch (double x) { cout << "Current balance: " << x << endl << "Balance must be greater than 1000.00" << endl; } In this code, identify the try block. In this code, identify the catch block. In this code, identify the catch block parameter and its type. In this code, identify the throw statement.
Computers and Technology
1 answer:
qaws [65]4 years ago
8 0

Answer:

Answer given below

Explanation:

Program:

1. double balance;

2. try{

3. cout<<"Enter the balance :";

4. cin >> balance;

5. cout<<endl;

6. if(balance < 1000.00)

7. throw balance;

8. cout<<"Leaving the try block."<<endl;

9. }

10. catch(double x){

11. cout<<" Current balance : "<<x<<endl<<"Balance must be greater than 1000.00"<<endl;;

12. }

Answer A:

If we consider the above program lines, try block represents from 2 to 9 lines.

Answer B:

If we consider the above program lines, catch block represents from 10 to 12 lines.

Answer C:

catch block parameter is x and its type is double.

Answer D:

If we consider the above program lines, line number 7 indicates throw statement.

You might be interested in
Match the following.
vitfil [10]

Answer:

1192783728439

Explanation:

3 0
3 years ago
Wi-Fi is all around us. Is there any downside to its pervasiveness?
Mandarinka [93]

Answer:

  Wi-Fi(Wireless fidelity) is the networking technology that helps in providing the internet connectivity to the users. The Wi-Fi is all around the surrounding due to several Wi-Fi connections the users demand and use. It creates the networking environment where internet access becomes easy.

There are drawback to Wi-Fi service range that covers a large area is the high number of users.The addition of many users slow down the data rate and accessing .The radiation from this service is also a negative side of the Wi-Fi pervasiveness.

6 0
4 years ago
Write a code block to encode strings from original messages, using our custom encoding. To do so: Initialize a variable called c
blondinia [14]

Answer:

  1. custom_encoded = ""
  2. custom_message = "this is a pen"
  3. custom_encoding = {
  4.    "a": "1",
  5.    "e": "2",
  6.    "i": "3",
  7.    "o": "4",
  8.    "u": "5"
  9. }
  10. for c in custom_message:
  11.    if(c in custom_encoding):
  12.        custom_encoded = custom_encoded + custom_encoding[c]
  13.    else:
  14.        custom_encoded = custom_encoded + c
  15. print(custom_encoded)

Explanation:

The solution code is written in Python 3.

Let's define a variable custom_encoded with an empty string (Line 1).

Create another variable custom_message and set a sample string to it (Line 2).

Create one more variable custom_encoding to hold the mapping values between vowel and their respective encoded character (Line 3-9).

Create a for loop to loop through all the character in custom_message (Line 11) and in the loop check if the current character is found in custom_encoding dictionary, if so, use the current character to loop up the dictionary for the encoded value and add the encoded string to custom_encoded (Line 12-13). Otherwise, just add the current character to custom_encoded (Line 14-15).

At the end, print the custom_encoded to terminal and you shall get th3s 3s 1 p2n

3 0
3 years ago
Suppose we are given an arbitrary digraph G = (V, E) that may or may not be a DAG. Modify the topological ordering algorithm so
lianna [129]

Answer:

Check the explanation

Explanation:

We can utilize the above algorithm with a little in modification. If in each of the iteration, we discover a node with no inward edges, then we we’re expected succeed in creating a topological ordering.

If in a number of iteration, it becomes apparent that each of the node has a minimum of one inward edge, then there must be a presence of cycle in the graph.

So our algorithm in finding the cycle is this: continually follow an edge into the node we’re presently at (which is by choosing the first one on the adjacency list of inward edges to decrease the running time).

Since the entire node has an inward edge, we can do this continually or constantly until we revisit a node v for the first time.

The set of nodes that we will come across among these two successive visits is a cycle (which is traversed in the reverse direction).

3 0
4 years ago
The answer for 1 and 2
Mrrafil [7]
1. A.  It is basically the definition of a political cartoon.
2. D. They used newspaper, protesting, and marches.
<span />
6 0
4 years ago
Other questions:
  • What New England industry quickly collapsed with the discovery of oil in Pennsylvania?
    11·2 answers
  • "______" is a wireless local network that uses high frequency radio signals to transmit an Internet signal from a wireless route
    9·1 answer
  • Define the following concepts: computer network, network architecture, protocol, and multilayer protocol.
    11·1 answer
  • The idea of supply and demand is based on the development of
    10·2 answers
  • A large lens can be very heavy and can only be supported at the_______.
    13·1 answer
  • Which of the following provides services to hosts on its network?
    9·1 answer
  • Will technology be the destruction or salvation of human-kind
    13·2 answers
  • PLEASE HELP!!! WILLGIVE BRAINLIEST!!!
    11·2 answers
  • Algoritmos para llevar a cabo una actividad
    15·1 answer
  • Define computer architecture?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!