Practice Test: Question Set - 03
1. You can throw ________
- (A) A
scalar variable
- (B) A
constant
- (C) A
programmer-defined class object
- (D) Any
of these
2. When you define an object that is a member of a class, such as Student Abby; ________
- (A) A
block of memory is set aside and all data members are assigned valid values
- (B) A
block of memory is set aside
- (C) No
memory is set aside until values are defined
- (D) No
memory is set aside, but valid values are assigned to data members
3. Files whose names end in .h are called _______ files
- (A) Handy
- (B) Header
- (C) Helper
- (D) Helping
4. "Rohan Motors" is a _______
- (A) Character
literal constant
- (B) Numeric
literal constant
- (C) String
literal constant
- (D) Variable
5. The String data type is an extension of the ________ data type
- (A) Character
- (B) Double
- (C) Letter
- (D) Long
6. A _______ is a single item of information about a person, place, or thing
- (A) Data file
- (B) Field
- (C) Program file
- (D) Record
7. Which of the following numerical value(s) is(are) invalid constant(s)?
- (A) 0.7
- (B) 9.3el2
- (C) 27,512
- (D) 12345678
8. Before object-oriented exception handling was practiced, ________
- (A) No
run-time errors occurred
- (B) Programmers
could not deal with run-time errors
- (C) The
most popular error-handling method was to terminate the program
- (D) The
most popular error-handling method was to throw an exception
9. The function whose prototype is Item getData(void); returns ________
- (A) The
address of a structure
- (B) A
copy of a structure
- (C) A
pointer to a structure
- (D) Nothing
10. # directives must be present
- (A) Before the
main() function
- (B) After
the main() function
- (C) At
the end of the program
- (D) Anywhere
in the program body
11. The time and memory involved in calling a function represent the function's _______
- (A) Prototype
- (B) Overhead
- (C) Cost
- (D) Burden
12. The bitwise OR operator is a
- (A) Unary
operator
- (B) Binary
operator
- (C) Ternary
operator
- (D) Octal
operator
13. If you wanted to sort many large objects or structures, it would be most efficient to
- (A) Place
them in an array and sort the array
- (B) Place
pointers to them in an array and sort the array
- (C) Place them
in a linked list and sort the linked list
- (D) Place
references to them in an array and sort the array
14. The >> (extraction) operator stops reading characters from the keyboard as soon as the user _______
- (A) Presses the
Enter key
- (B) Types
a character that is inappropriate for the variable's data type
- (C) Both (a) and
(b)
- (D) None of
these
15. Which of the following is a C++ class?
- (A) >>
- (B) read()
- (C) cin
- (D) iostream
Next Tests: