Question

In: Computer Science

true or false C++ a.    (T or F)  There can be no code between a try-block and its...

true or false C++

a.    (T or F)  There can be no code between a try-block and its associated catch-block.

b.    (T or F)  The reserved word throw is used to signal that an exception has occurred.

c.    (T or F)  The correct use of throw can be anywhere in a program; a try /  catch structure is used only in class definitions.

d.    (T or F)  In C++, class is not a reserved word.

e.    (T or F)  Class attributes have no fixed type; their type can be changed during the program execution.


Solutions

Expert Solution

Question a:

Answer :False

Explanation :

  • if there is no code between try block and catch block then there is no use of using try catch block
  • try catch block needs to have a code so any kind of exception can be handeled

*****************************************

Question b:

Answer :True

Explanation :

  • If an exception is occured then it is thown by using throw keyword
  • Exception thown is handled in the catch block

*****************************************

Question c:

Answer :False

Explanation :

  • throw can be anywhere in a program
  • but a try /  catch structure is used only in the main method

*****************************************

Question d:

Answer :False

Explanation :

  • In C++ Class is reserved word which is used to declare a class
  • Like Class A{}

*****************************************

Question e:

Answer :True

Explanation :

  • Class can contains different attributes of different data type like int , float , char etc
  • Data type of a variable can be changed during program execution

*****************************************


Related Solutions

true or false C++ a.    (T or F)  A member of a class can be a method or...
true or false C++ a.    (T or F)  A member of a class can be a method or an attribute. b.    (T or F)The private attributes of a class cannot be accessed by the public methods of that class. c.    (T or F)  The initialization of a variable in the declaration Ex:  int counter = 0; is not allowed inside a class definition. d.    (T or F)  In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition....
Indicate whether the following statements are always true or can be false. (Select T-True, F-False. If...
Indicate whether the following statements are always true or can be false. (Select T-True, F-False. If the first is F and the rest T, enter FTTTTT). A) In order not to slow down, a bicycle moving at a constant velocity needs a small net force applied. B) If two objects have the same acceleration, they are under the influence of equal forces. C) If a net force acts on an object, the object's velocity will change. D) During the collision...
True or False—Indicate if the statement is True (T) or False (F) for each of the...
True or False—Indicate if the statement is True (T) or False (F) for each of the following 10 statements: __________ 1. While variable costs are always relevant to a business decision, fixed costs are not, and need to be analyzed closely to determine if they will be different amongst the alternatives being considered. __________ 2. Facility level costs often include costs such as rent, property taxes, building maintenance, and utilities; facility level costs benefit the production process as a whole...
Please try to solve all of them True/false questions T   F         A blocking assignment in Verilog...
Please try to solve all of them True/false questions T   F         A blocking assignment in Verilog is used to synchronize assignment statements so that they appear to execute at the same time. T          F           A blocking assignment in Verilog completes execution before next statement executes. T          F           Verilog Hardware description language is case sensitive. T          F           An “if” statement must always be inside of an “always” block. T          F           Verilog may be written at the Behavioral, Structural, Gate, Switch and...
18H. TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false....
18H. TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 11. Production of traded goods falls in countries that export them. 12. International trade allows the world to use its resources more efficiently but one country’s gains are another country’s losses. 13. A country’s ability to produce a specific good with fewer resources than another country determines whether it has an absolute advantage in producing the good. 14. Comparative advantage is based on the...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 1)...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 1) Accounting is an information system that identifies, measures, records and 1) communicates relevant information that objectively and correctly represents an organization's economic activities. 2) The main objective of accounting is to help people to invest in new products and 2) businesses. 3) A sole proprietorship is a business owned by one or more persons. 3) 4) Unlimited liability is an advantage for both a...
True/False Please write T if the statement is true or F if the statement is false:...
True/False Please write T if the statement is true or F if the statement is false: ____1. The contribution format income statement can be expressed in the following equation: Profit = (Sales – Variable expenses) – Fixed expenses.           ____2. The CM ratio can also be calculated by dividing the contribution margin per unit by the selling price per unit.      _____3.    Margin of safety in dollars = Total sales - Break-even sales        _____4.   The margin of safety cannot...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 6)...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 6) Compounding always requires the use of a financial calculator. 7) In the compound interest formula, i stands for periodic interest rate. 8) Interest calculated on a balance every three months is said to be compounded quarterly. 9) The present value of an annuity looks from the present to the future. 10) Annuities certain have a specific stated number of payments. 11) A bond quote...
true or false C++ a.    (T or F)   A function or method cannot return a value of type...
true or false C++ a.    (T or F)   A function or method cannot return a value of type array. b.    (T or F)   C++ throws an exception if you try to refer to element 47 in an array with 20 elements. c.    (T or F)   I can copy one array to another by simply using an assignment statement which assigns the one array to the other. d.    (T or F)  An exception is the occurrence of an erroneous or unexpected situation during the execution of a program. e.    (T...
True/False Type T (for True) or F (for False) for each statement for both Discrete and...
True/False Type T (for True) or F (for False) for each statement for both Discrete and Continuous random variables. Question 19 The cdf F(x) is strictly increasing. Discrete: Continuous: Question 20 The cdf F(x) is between 0 and 1 (inclusive). Discrete: Continuous: Question 21 The limit as x → ∞ of F(x) is 1. Discrete: Continuous: Question 22 If x1 is the largest value in the range of X, then F(x1) = f(x1). Discrete: Continuous: Question 23 The pf/pdf f(x)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT