Practice Test: Question Set - 19
1. The return type you code for all constructors is _______
- (A) Void
- (B) The class
type
- (C) The
same type as the first data member defined in the class
- (D) No type
2. Which of the following control structures is used in every program?
- (A) Repetition
- (B) Selection
- (C) Sequence
- (D) Switching
3. Providing two or more constructors for the same class ________
- (A) Requires
different argument lists
- (B) Requires
different constructor names
- (C) Requires
different constructor types
- (D) Is
illegal
4. Which of the following statements uses the computer's clock to initialize the random number generator?
- (A) srand(time);
- (B) srand(time(NULL));
- (C) time(srand);
- (D) time(srand(NULL));
5. A derived class may also be called a
- (A) Subclass
- (B) Super class
- (C) Parent class
- (D) Derived
class
6. A function that is prototyped as double calculate(int num); may________
- (A) Receive an
integer constant such as 5
- (B) Receive an
integer variable
- (C) Either (a)
or (b)
- (D) Neither (a)
nor (b)
7. Evaluate the following expression: 7 >=3 + 4 || 6<4 && 2<5
- (A) True
- (B) False
8. The loosest type of coupling is
- (A) Data
coupling
- (B) Control
coupling
- (C) External
coupling
- (D) Pathological
coupling
9. Making class members inaccessible to nonmember functions is an example of
- (A) Polymorphism
- (B) Data hiding
- (C) Redundancy
- (D) Recursion
10. When you create a derived class and instantiate an 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
11. The 'break' statement is used to exist from
- (A) A do loop
- (B) A for loop
- (C) A
switch statement
- (D) All of the
above
12. A predefined function that may be used to handle memory allocation errors is
- (A) handle_error
- (B) set_new_handler
- (C) new_fix
- (D) memory_error
13. If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
- (A) Each
object's nonstatic data members will be stored in the same memory location
- (B) Each object will
be stored in the same memory location
- (C) Each object
will have a unique memory address
- (D) You cannot
declare two objects of the same class
14. Which of the following statements will create and initialize a feelnfo array named fee?
- (A) fee feeInfo
= {{0}, {0}};
- (B) fee as
feeInfo = 0, 0;
- (C) feeInfo fee
= 0, 0;
- (D) feeInfo fee
= {0,0};
15. Which of the following creates an animal object named dog?
- (A) Animal
"dog";
- (B) Animal dog;
- (C) Dog
"animal";
- (D) Dog animal;
Next Tests: