Practice Test: Question Set - 26
1. Of the three ways to pass arguments to functions, only passing by _______ and passing by _______ allow the function to modify the argument in the calling program
- (A) Reference,
pointer
- (B) Array,
location
- (C) Array,
pointer
- (D) None
of the above
2. When you create a derived class and instantiate on object
- (A) The
parent class object must be constructed first
- (B) The
child class object must be constructed first
- (C) The
parent class object must not be constructed
- (D) The
child class object must not be constructed
3. A function that uses variable types is called ________
- (A) Overloaded
- (B) A
template function
- (C) A
variable function
- (D) A
virtual function
4. The _______ mode tells C++ to open a file for input
- (A) add::ios
- (B) in::file
- (C) ios::app
- (D) ios::in
5. The return type for all destructors is
- (A) The class
- (B) Void
- (C) The same as
the first data in the class
- (D) None
6. Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
- (A) Public
members of Base
- (B) Protected
members of Base
- (C) Private
members of Base
- (D) Public
members of Derv
7. Format flags may be combined using
- (A) The bitwise
OR operator (|)
- (B) The logical
OR operator (||)
- (C) The bitwise
AND operator (&)
- (D) The logical
AND operator (&&)
8. In object-oriented terms, an exception may be considered a(n) _______
- (A) Child
- (B) Encapsulation
- (C) Message
- (D) Scalar type
9. The code class Descendant : virtual public Ancestor indicates that
- (A) The
members of Ancestor will be included more than once in Descendant
- (B) The
members of Ancestor will be included only once in Descendant
- (C) The
members of Descendant will be included more than once in Ancestor
- (D) The
members of Descendant will be included only once in Ancestor
10. If you design a class that needs special initialization tasks, you will want to design a(n) ________
- (A) Housekeeping
routine
- (B) Initialize
- (C) Constructor
- (D) Compiler
11. The delete operator returns ________ to the operating system
- (A) Memory
that is no longer needed
- (B) Void
- (C) Recycle bin
- (D) None of the
above
12. The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} };
- (A) Assigns a
value 2 to num[1][2]
- (B) Assigns a
value 4 to num[1][2]
- (C) Gives an
error message
- (D) Assigns a
value 3 to num[1][2]
13. The #ifndef directive tests to see whether ________
- (A) A
class has been defined
- (B) A
variable has been given a value
- (C) A
class has no variable definitions
- (D) Any
objects of the class have been instantiated
14. You have assigned the address of Value to the pointer P, Which statement will display the value stored in Value?
- (A) cout<<P;
- (B) cout<<*Value;
- (C) cout<<&P;
- (D) cout<<*P;
15. If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _______ element
- (A) code[2]
- (B) code[3]
- (C) fee[2]
- (D) fee[3]
Next Tests: