When the function int someFunction(char c) throw( ) is executed, _____
A. it can throw anything
B. it may throw an integer
C. it may throw a character
D. it may not throw anything
Select an option to see the answer and solution.
The two statements that can be used to change the flow of control are
A. if and switch
B. if and while
C. switch and do-while
D. break and continue
E. None of the above
Select an option to see the answer and solution.
If p and q are assigned the values 2 and 3 respectively then the statement p = q++
A. gives an error message
B. assigns a value 4 to p
C. assigns a value 3 to p
D. assigns a value 5 to p
E. None of the above
Select an option to see the answer and solution.
Which of the following is the insertion operator?
A. >>
B. <<
C. //
D. /*
E. both (a) and (b)
Select an option to see the answer and solution.
If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as
A. static
B. unary
C. dynamic
D. volatile
Select an option to see the answer and solution.
To use a template class member function, use the ________ with the instantiation
A. scope resolution operator
B. dot operator
C. class definition
D. keyword template
Select an option to see the answer and solution.
When a class is derived from another derived class, the newly derived class
A. may have more liberal access to a base class member than its immediate predecessor
B. may have the same type of access to a base class member as its immediate predecessor
C. may have more limited access to a base class member than its immediate predecessor
D. both (b) and (c)
Select an option to see the answer and solution.
If you assign a default value to any variable in a function prototype's parameter list, then _____
A. all other parameters in the function prototype must have default values
B. all parameters to the right of that variable must have default values
C. all parameters to the left of that variable must have default values
D. no other parameters in that prototype can have default values
Select an option to see the answer and solution.
The dot operator (or class member access operator) connects the following two entities (reading from left to right):
A. a class member and a class object
B. a class object and a class
C. a class and a member of that class
D. a class object and a member of that class
Select an option to see the answer and solution.
Which of the following calls a function named displayName, passing it no actual arguments?
A. call displayName;
B. call displayName ();
C. displayName;
D. displayName();
Select an option to see the answer and solution.
The feature that allows you to use the same function name for separate functions that have different argument lists is called _____
A. overriding
B. overloading
C. constructing
D. destructing
Select an option to see the answer and solution.
Which of the following are valid characters constants?
A. '\n'
B. '\\'
C. '\0'
D. All of the above
E. None of the above
Select an option to see the answer and solution.
With a template class, _____ type is generic
A. no
B. exactly one
C. at least one
D. at most one
Select an option to see the answer and solution.
If you want to use a class to define objects in many different programs, you should define the class in a C++ _____ file
A. header
B. program
C. source
D. text
Select an option to see the answer and solution.
Functions that returns information about an object's state can be classified as ________
A. inspector functions
B. mutator functions
C. auxiliary functions
D. manager functions
Select an option to see the answer and solution.
An auxiliary function _____
A. return information about data members
B. changes the state of data members
C. performs an action or service
D. creates and destroys objects
Select an option to see the answer and solution.
To create and execute a C++ program, you need to have access to
A. a C++ compiler
B. a C++ translator
C. an object code editor
D. a text editor
E. both (a) and (d)
Select an option to see the answer and solution.
If you omit any constructor argument when you instantiate an object, you must use default values______
A. for all parameters to the constructor
B. for all parameters to the right of the argument
C. for all parameters to the left of the argument
D. for no other parameters
Select an option to see the answer and solution.
Many programmers separate a class into two files: _____
A. one for the declarations and one for the implementations
B. one for the void functions and one for the other functions
C. one for the public data and one for the private data
D. one for the primary functions and one for the auxiliary functions
Select an option to see the answer and solution.
Files whose names end in .h are called _____ files
A. handy
B. header
C. helper
D. helping
Select an option to see the answer and solution.