Practice Test: Question Set - 20
1. The base class for most stream classes is the _______ class
- (A) ios
- (B) out
- (C) in
- (D) app
2. When the function char someFunction(int x) is executed,
- (A) It
will throw nothing
- (B) It
will throw an integer
- (C) It
will throw a character
- (D) It
may or may not throw anything
3. Which of the following, if any, are valid names for variables?
- (A) amt.Sold
- (B) amt-Sold
- (C) amt_Sold
- (D) None
of the above are valid names for variables
4. In a class specifier, data or functions designated private are accessible
- (A) To
any function in the program
- (B) Only
if you know the password
- (C) To
member functions of that class
- (D) Only
to public members of the class
5. If you want to override constructor default values for an object you are instantiating, you must also override
- (A) All
other parameters to that constructor
- (B) All
parameters to the left of that value
- (C) All
parameters to the right of that value
- (D) No
other parameters to that constructor
6. Which of the following instructions tells C++ to merge the source code from the iostream.h file into the current file?
- (A) #include
<iostream.h>
- (B) #include
iostream.h
- (C) #include
<iostream.h>
- (D) None of the
above
7. Which of the following statements is true?
- (A) Data
coupling is tighter than pathological coupling
- (B) Common
coupling is looser than data coupling
- (C) Data-structured
coupling is looser than control coupling
- (D) Control
coupling is looser than data coupling
8. If an exception is thrown and no catch block matches the type of the thrown parameter, then _______
- (A) The program
terminates
- (B) The
first catch block is executed
- (C) The
last catch block is executed
- (D) The
program proceeds with the code following the catch blocks
9. The right shift operator is represented by the symbol
- (A) >
- (B) >>
- (C) ->
- (D) <
10. In a C++ program, which of the following can be thrown?
- (A) Scalar
variables
- (B) Programmer-defined
objects
- (C) Both (a) and
(b)
- (D) Neither (a)
nor (b)
11. Which of the following statements creates a named constant called driverAge whose value is 16?
- (A) const
driverAge = 16;
- (B) const short
driverAge = 16;
- (C) driverAge
=16;
- (D) namedconst
driverAge =16;
12. You can code a default exception handler by creating a catch block
- (A) With
no arguments
- (B) With a void
argument
- (C) With an
ellipsis as its argument
- (D) With
an argument identical to that thrown
13. Errors in a program are called
- (A) Accidents
- (B) Annoyances
- (C) Bugs
- (D) Mistakes
14. A(n) _______ is a numeric variable used for counting something
- (A) Accumulator
- (B) Adder
- (C) Constant
- (D) Counter
15. The operator that releases previously allocated memory is ________
- (A) Release
- (B) Return
- (C) Delete
- (D) Destroy
Next Tests: