C++ Questions Question 1 Question text Left uncaught, a thrown exception will ca
ID: 3771082 • Letter: C
Question
C++ Questions
Question 1
Question text
Left uncaught, a thrown exception will cause your program to terminate.
Select one:
a. FALSE
b. TRUE
Question 2
Question text
Only a pointer variable can be set to have the value NULL.
Select one:
a. TRUE
b. FALSE
Question 3
Question text
Any function, variable declaration or class method can be marked virtual.
Select one:
a. FALSE
b. TRUE
Question 4
Question text
For a class Foo, one difference between a variable declared Foo * and a variable declared Foo & is that only the variable declared Foo & can potentially have the value NULL.
Select one:
a. FALSE
b. TRUE
Question 5
Question text
Whenever they are passed as parameters to a function, the IO classes istream and ostream must be passed using a pass-by-value parameter passing scheme.
Select one:
a. TRUE
b. FALSE
Question 6
Question text
When no class constructors are supplied by the author of a class, that class will generated errors when compiled in C++.
Select one:
a. FALSE
b. TRUE
Question 7
Question text
The body of a do { ... } while(...); loop may never execute at all, depending on what test condition is stated.
Select one:
a. FALSE
b. TRUE
Question 8
Question text
The body of a while(...) { ... } loop may never execute depending on what test condition is stated.
Select one:
a. FALSE
b. TRUE
Question 9
Question text
A throw(...) statement is an alternative way to return from a function or method that indicates some kind of failure occurred.
Select one:
a. TRUE
b. FALSE
Explanation / Answer
C++ Answers
Question 1
Left uncaught, a thrown exception will cause your program to terminate.
b. TRUE
Question 2
Only a pointer variable can be set to have the value NULL.
b. FALSE // char c = NULL is valid
Question 3
Any function, variable declaration or class method can be marked virtual.
a. FALSE
Question 4
For a class Foo, one difference between a variable declared Foo * and a variable declared Foo & is that only the variable declared Foo & can potentially have the value NULL.
a. FALSE //pointer can also be NULL
Question 5
Whenever they are passed as parameters to a function, the IO classes istream and ostream must be passed using a pass-by-value parameter passing scheme.
b. FALSE // only by reference to avoid creating a copy of the object
Question 6
When no class constructors are supplied by the author of a class, that class will generated errors when compiled in C++.
a. FALSE //If constructor definition is not explicitly mentioned by author then no error will be generated
Question 7
The body of a do { ... } while(...); loop may never execute at all, depending on what test condition is stated.
a. FALSE //it is executed at least once
Question 8
The body of a while(...) { ... } loop may never execute depending on what test condition is stated.
b. TRUE
Question 9
A throw(...) statement is an alternative way to return from a function or method that indicates some kind of failure occurred.
a. TRUE
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.