Practice Test: Question Set - 14
1. Recursive Functions
- (A) Easier
to code
- (B) Executable
faster than iterative ones
- (C) Takes
less main storage space
- (D) Necessary
to solve a certain class of problems
2. The preprocessor directive always starts with the symbol
- (A) %
- (B) &
- (C) #
- (D) ""
3. A child class _______ exist if there is no parent class
- (A) Must
- (B) May
- (C) Cannot
- (D) Can
4. Which of the following C++ expressions is equivalent to the mathematical expression 53?
- (A) 5 ^ 3
- (B) cube(5)
- (C) pow (3, 5)
- (D) pow(5, 3)
5. Which of the following can be used to declare the main function?
- (A) void main
- (B) void Main()
- (C) void main()
- (D) main
6. With commercial classes, the function source code is usually________
- (A) Printed
on high-quality paper
- (B) Poorly
written
- (C) Provided
on a disk
- (D) Provided
in object form
7. The actual arguments cannot he
- (A) A constant
or a variable
- (B) Of
a different type from the corresponding formal arguments
- (C) Other
functions
- (D) Expressions
8. The highest level of cohesion is
- (A) Functional
cohesion
- (B) Temporal
cohesion
- (C) Logical
cohesion
- (D) Sequential
cohesion
9. Which of the following creates a String named constant called partNo, whose value is AB45?
- (A) const
char[4] partNo = "AB45";
- (B) const
char[5] partNo = 'AB45';
- (C) const
char[5] partNo = "AB45";
- (D) const char
partNo[5] = "AB45";
10. A function argument is
- (A) A
variable in the function that receives a value from the calling program
- (B) A
way that functions resist accepting the calling program's values
- (C) A value sent
to the function by the calling program
- (D) A
value returned by the function to the calling program
11. The first element in a string is
- (A) The name of
the string
- (B) The
first character in the string
- (C) The length
of the string
- (D) The
name of the array holding the string
12. When a multidimensional array is accessed, each array index is
- (A) Separated
by commas
- (B) Surrounded
by brackets and separated by commas
- (C) Separated
by commas and surrounded by brackets
- (D) Surrounded
by brackets
13. Passing a variable pointer as a constant ________
- (A) Protects
the contents pointed to by the pointer from change
- (B) Eliminates
the need to name the pointer in the function
- (C) Eliminates
the need to give the pointer a type in the function
- (D) Causes
a copy of the pointer to be produced in the function
14. Assume that a program includes the short *agePtr = NULL; statement. The name of the pointer is _______
- (A) *agePtr
- (B) agePtr
- (C) Both (a) and
(b)
- (D) None of the
above
15. When a break statement is used in a loop, the control skips the rest of the statements in the loop after it and jumps
- (A) To
the last lines in the program
- (B) To
the next statement written after the body of the loop
- (C) To
the first statement in the body of the loop
- (D) None
of the above
Next Tests: