Practice Test: Question Set - 21
1. The logical NOT operator represented by is a
- (A) Unary
operator
- (B) Binary
operator
- (C) Ternary
operator
- (D) Octal
operator
2. You can use C++ as a procedural, as well as an object-oriented, language
- (A) True
- (B) False
3. An object is ________
- (A) A
category of classes
- (B) A
name given to a class
- (C) An
instance of a class
- (D) The
same as a class
4. To expose a data member to the program, you must declare the data member in the ________ section of the class
- (A) Common
- (B) Exposed
- (C) Public
- (D) Unrestricted
5. Which of the following is false?
- (A) You
enclose a function's statements in a set of braces
- (B) The
function header is considered a C++ statement, so it must end in a semicolon
- (C) The
keyword void tells the C++ compiler that the function does not return a value
- (D) A function
can receive information that you send (pass) to it
6. Which of the following is an access specifier?
- (A) Particular
- (B) Shielded
- (C) Protected
- (D) Safe
7. When the compiler cannot differentiate between two overloaded constructors, they are called
- (A) Overloaded
- (B) Destructed
- (C) Ambiguous
- (D) Dubious
8. Separating parts of a program into units that remain unaffected by other parts of a program is the concept known as _______
- (A) Intrusion
- (B) Volatility
- (C) Encapsulation
- (D) Protection
9. An asterisk placed after a data type means.
- (A) Array to
- (B) Pointer to
- (C) Address to
- (D) Located to
10. The newline character is always included between
- (A) Pair
of parentheses
- (B) Pair
of curly braces
- (C) Control
string
- (D) &
11. The main difference in operation between an 'if statement and a 'while' statement is
- (A) The
'while' loop body is executed
- (B) The body of
the 'while' statement may be executed many times, the body of the 'if
statements only once
- (C) The
conditional expression following the keyboard is evaluated differently
- (D) None
of the above
12. The function printDataMembers() is not likely a(n) ________
- (A) Inspector
functions
- (B) Mutator
functions
- (C) Auxiliary
functions
- (D) Manager
functions
13. If container classes are carefully constructed, then these tools are available to work with structures that are not ________
- (A) Valid
without container classes
- (B) Programmer-defined
- (C) Type-specific
- (D) Public
14. A constructor initialization list is preceded by
- (A) A
semicolon
- (B) A
colon
- (C) Two
colons
- (D) A
space
15. Which of the following formulas can be used to generate random integers between 1 and 10?
- (A) 1 + rand() %
(10 - 1 + 1)
- (B) 1 + (10 - 1
+ 1) % rand()
- (C) 10 + rand()
% (10 - 1 + 1)
- (D) 10 + rand()
% (10 + 1)
Next Tests: