Computer Science Quiz 10
A problem can be solved with recursion if it can be broken down into successive smaller problems that are identical to the overall problem.
True
Any problem that can be solved recursively can also be solved iteratively, with a loop. T/F
True
In programming, a function is a named section of a program that performs a specific task. In this sense, a function is a type of ____ or ____. Some programming languages make a distinction, which returns a value, and a procedure, which performs some operation but does not return a value.
procedure - subroutine
A function ____ eliminates the need to place a function definition before all calls to the function
prototype
A ____ function is one that calls itself.
recursive
When used as parameters, ____ variables allow a function to access the parameter's original argument. Changes to the parameter are also made to the argument.
reference
A function can send a value to the part of the program that executed it. This value is called a ____ value.
return
Variables that are defined inside a function that remain in memory after the function has finished executing are called ____ variables
static
____ local variables exist for the lifetime of the program, even though their scope is only the function in which they are defined.
static
A ____ is a dummy function that is called instead of the actual function it represents. It usually displays a test message acknowledging that it was called, and nothing more.
stub
A ____ function is a function that does not return a value to the part of the program that executed it.
void
____ arguments are passed to parameters automatically if no argument is provided in the function call.
default
A function ____ contains the interface to the function as well as the statements that make up the function.
definition
____ recursion is when a recursive function calls itself.
direct
____ is code that tests a function by simply calling it.
driver code
____ recursion occurs when function A calls function B, which in turn calls function A.
indirect
A ___ is a package of code that is meant to be reused by many programs
library
A ____ is a collection of precompiled routines that a program can use.
library
When a copy of an argument is passed to a function, it is said to be ____.
pass by value
When a reference variable is used as a parameter, it is said that the argument is ____.
passed by reference
The very first line of a function definition is the function ____.
header
Values that are sent to a function are called ____ (aka ____).
arguments (actual parameters)
The ____ is the part of a calculation that can be solved without recursion. This stops the recursive function from continuing to call itself.
base case.
In computer programming, ____ code is part of the source code of a program which can never be executed because there exists no control flow path code form the rest of the program.
dead
____ involves writing and testing small portions of a program repeatedly until the program is complete
incremental development
The ____ of a function is the set of statements that perform the function's operation.
body
A function ____ is a statement that causes a function to execute.
call
Enclosing a group of statements inside a set of braces creates a ____.
code block
The order in which statements are executed in a program is referred to as the program's ____.
flow of execution.
The list of parameters indicated in the function definition are called ____ parameters
formal
A ____ is a collection of statements that performs a specific task.
function
A ____ is a programming construct that allows a programmer to associate a given set of instructions with a specific name.
function
A ____ constant is a named constant that is available to every function in a program.
global
A ____ variable is defined outside all functions and is accessible to all functions in its scope.
global
A ____ variable is defined inside a function and is not accessible outside the function.
local
Variables that are defined inside a function are called ____ variables.
local
Instead of writing one long program that contains all of the statements necessary to solve a problem, several small functions that each solve a specific part of the problem can be written. A program of this type is called a ____ program
modular
Function ____ is a programming concept that allows programmers to define two or more functions with the same name as long as each of the functions has a unique signature.
overloading
A ____ is a special variable that holds a value being passed into a function.
parameter