Question: What is true about the following code? template Type Twirl( Type n ) { return 4*n + 1; Question 1 options: a) It is a

 What is true about the following code? template Type Twirl( Type

What is true about the following code? template Type Twirl( Type n ) { return 4*n + 1;

Question 1 options:

a)

It is a template class.

b)

It is a class template.

c)

It is a template function.

d)

It is a function template.

Save

Question 2 (3 points)

n ) { return 4*n + 1; Question 1 options: a) It

True or False? For a given class template, the definitions of the associated member functions must be written as function templates.

Question 2 options:

True
False

Save

Question 3 (3 points)

is a template class. b) It is a class template. c) It

True or False? The basic purposes of exceptions is to allow one part of a program to report an error to another part of the program if the error cannot be handled locally.

Question 3 options:

True
False

Save

Question 4 (3 points)

is a template function. d) It is a function template. Save Question

Given a class class OutOfRange {}; which of the following statements could be used to throw an exception of this type?

Question 4 options:

a)

throw;

b)

throw OutOfRange;

c)

throw OutOfRange();

d)

b and c above

e)

a, b, and c above

Save

Question 5 (2 points)

2 (3 points) True or False? For a given class template, the

True or False? Function overloading refers to the error of storing too large a number into a function's local variable.

Question 5 options:

True
False

Save

Question 6 (3 points)

definitions of the associated member functions must be written as function templates.

Given the class template template class Stuff { ... }; which of the following is a valid template instantiation?

Question 6 options:

a)

Stuff myStuff;

b)

Stuff myStuff;

c)

Stuff myStuff;

d)

Stuff myStuff;

e)

none of the above

Save

Question 7 (2 points)

Question 2 options: True False Save Question 3 (3 points) True or

True or False? In C++, two different functions can be given the same name, as long as their parameters are sufficiently different.

Question 7 options:

True
False

Save

Question 8 (3 points)

False? The basic purposes of exceptions is to allow one part of

True or False? All exceptions are defined by the C++ programmer.

Question 8 options:

True
False

Save

Question 9 (3 points)

a program to report an error to another part of the program

True or False? In C++, the raise statement is used to generate or raise an exception.

Question 9 options:

True
False

Save

Question 10 (3 points)

if the error cannot be handled locally. Question 3 options: True False

True or False? An uncaught exception in C++ goes unnoticed by the computer system, and execution simply continues.

Question 10 options:

True
False

Save

Question 11 (2 points)

Save Question 4 (3 points) Given a class class OutOfRange {}; which

True or False? In a call to a template function that is missing the template argument, the compiler tries to deduce the argument by looking at the function arguments.

Question 11 options:

True
False

Save

Question 12 (3 points)

of the following statements could be used to throw an exception of

Suppose we have the following function: void Put( int n ) { cout

Question 12 options:

a)

We need one function definition with one function name.

b)

We need five different function definitions with five different function names.

c)

We need one function definition with five different function names.

d)

We need five different function definitions with one function name.

Save

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!