GUIDE QUESTIONS &
ANSWERS(SCORED A+)
________ functions may have the same name as long as their parameter lists are
different.
A) Two or more
B) Un-prototyped
C) None of these
D) No
E) Only two - ANSWERA) Two or more
A ________ argument is passed to a parameter when the actual argument is left out
of the function.
A) true
B) default
C) None of these
D) false
E) null - ANSWERB) default
A debugging process where you, the programmer, pretend you are a computer and
step through each statement while recording the value of each variable at each step
is known as:
A) none of these
B) hand-tracing
C) error-handling
D) hand-writing
E) error checking - ANSWERB) hand-tracing
A function can have no parameters, one parameter, or many parameters and can
return ________ value(s).
A) zero to many
B) None of these
C) no
D) only one
E) a maximum of ten - ANSWERD) only one
A function is executed when it is:
A) none of these
B) declared
C) called
D) prototyped
E) defined - ANSWERC) called
A loop that is inside another loop is called a(n):
A) post-test loop
,B) nested loop
C) pre-test loop
D) none of these
E) infinite loop - ANSWERB) nested loop
A named storage location in the computer's memory that holds a piece of information
is a(n):
A) none of these
B) operator
C) statement
D) variable
E) key word - ANSWERD) variable
A special value that marks the end of a list of values is a:
A) None of these
B) constant
C) variable
D) sentinel
E) counter - ANSWERD) sentinel
A two-dimensional array can be viewed as
A) all of these
B) none of these
C) increments and decrements
D) arguments and parameters
E) rows and columns - ANSWERE) rows and columns
A variable definition tells the computer:
A) none of these
B) the variable's name and its value
C) the variable's name and the type of data it will hold
D) the variable's data type and its value
E) whether the variable is an integer or a floating-point number - ANSWERC) the
variable's name and the type of data it will hold
A variable that is regularly incremented or decremented each time a loop iterates is a
A) None of these
B) constant
C) control
D) null terminator
E) counter - ANSWERE) counter
A variable, usually a bool or an int, that signals when a condition exists is known as
a(n):
A) logical operator
B) flag
C) none of these
D) relational operator
E)arithmetic operator - ANSWERB) flag
, A volatile type of memory that is used for temporary storage is:
A) none of these
B) the ALU
C) a disk drive
D) an address
E) RAM - ANSWERE) RAM
A(n) ________ is information that is passed to a function, and a(n) ________ is
information that is received by a function.
A) none of these
B) argument, parameter
C) prototype, header
D) function call, function header
E) parameter, argument - ANSWERB) argument, parameter
An array can store a group of values, but the values must be:
A) constants
B) the same data type
C) integers
D) none of these
E) integers and floating-point numbers - ANSWERB) the same data type
An element of a two-dimensional array is referred to by
A) the row subscript of the element followed by the column subscript of the element
B) none of these
C) a comma followed by a semicolon
D) the array name followed by the column number of the element
E) the row subscript of the element followed by the array name - ANSWERA) the row
subscript of the element followed by the column subscript of the element
Arrays must be ________ at the time they are ________.
A) re-scoped, deleted
B) sized, executed
C) none of these
D) initialized, declared
E) compiled, typed - ANSWERD) initialized, declared
Character constants in C++ are always enclosed in:
A) single quotation marks ( ' ' )
B) pound sign and semicolon ( # ; )
C) brackets ( < > )
D) braces ( { } )
E) Any of these - ANSWERA) single quotation marks ( ' ' )
Given the following function:
void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;