Chapters 6 and 7-- C++ Computer Programming

a function
A collection of statements that perform a specific task.
definition
A function ____ contains the statements that make up a function.
We will write a custom essay sample on
Chapters 6 and 7– C++ Computer Programming
or any similar topic only for you
Order now
only one
A function can have zero to many parameters, and it can return this many values.
called
A function is executed when it is…
data type(s) of the parameters,
data type of the return value,
name(s) of parameter variables,
the name of function
In a function header, you must furnish:
calls
Functions are ideal for use in menu-driven programs. When a user selects a menu item, the program _____ the appropriate function.
local
This type of variable is defined inside a function and is not accessible outside the function.
static
The value in this type of local variable persists between function calls.
default
These types of arguments are passed to parameters automatically if no argument is provided in the function call.
reference
When used as parameters, these types of variables allow a function to access the parameter’s original argument.
return
This statement causes a function to end.
two or more
_____ functions may have the same name, as long as their parameter lists are different.
exit( )
This function causes a program to terminate, regardless of which function or control mechanism is executing.
function call
This is a statement that causes a function to execute.
document
It is a good programming practice to _____ your functions by writing comments that describe what they do.
argument; parameter
A(n) _____ is information that is passed to a function, and a(n) _____ is information that is received by a function.
persist
If a function is called more than once in a program, the values stored in the function’s local variables do not _____ between function calls.
default
A _____ argument is passed to a parameter when the actual argument is left out of the function call.
header
If a function does not have a prototype, default arguments may be specified in the function _____.
EXIT_SUCCESS
EXIT_FAILURE and _____ are named constants that may be used to indicate success or failure when the exit() function is called.
static local
The value in a _____ variable persists between functions.
stub
This is a dummy function that is called instead of the actual function it represents.
double
Look at the following function prototype:

int myFunction(double);

What is the data type of the function’s parameter variable?

int
Look at the following function prototype:

int myFunction(double);

What is the data type of the function’s return value?

prototype
A function _____ eliminates the need to place a function definition before all calls to the function
global
A _____ variable is declared outside all functions.
elements
The individual values contained in an array are known as _____.
arrays
Unlike regular variables, these can hold multiple values.
int array[10];
Which of the following is a valid C++ array definition?
implicit array sizing
The statement: int grades [ ] = {100, 90, 99, 80}; shows an example of:
subscript
By using the same _____ you can build relationships between data stored in two or more arrays.
memory address
The name of an array stores the _____ of the first array element.
the same data type
An array can store a group of values, but the values must be:
constant interger; zero
An array’s size declarator must be a _____ with a value greater than _____.
begins with zero
Subscript numbering in C++
initialized; called
Arrays may be _____ at the time they are _____.
scores [2]
Given the following declaration, where is the value 77 stored in the scores array?

int scores [ ] = {83, 62, 77, 97};

subscript
To access an array element, use the array name and the element’s _____.
4
What is the last legal subscript that can be used with the following array?
int values [5];
for loop
An array can easily be stepped through by using a _____.
range variable
The range-based for loop, in C++ 11, is designed to work with a built-in variable known as the _____.
a loop
To assign the contents of one array to another, you must use _____.
name
To pass an array as an argument to a function, pass the _____ of the array.
initialization list
A(n) _____ can be used to specify the starting values of an array.
string names[5];
An array of string objects that will hold 5 names would be declared using which statement?
55
What will the following code display?

int numbers [ ] = {99, 87, 66, 55, 101};
cout << numbers[3] << endl;

null terminator
The _____ is automatically appended to a character array when it is initialized with a string constant.
illegal in C++
An array with no elements is _____.
legal in C++
It is _____ to pass an argument to a function that contains an individual array element, such a numbers[3].
vector v;
Which statement correctly defines a vector object for holding integers?
vector n {10, 20};
Which statement correctly uses C++11 to initialize a vector of ints named n with the values 10 and 20?
push_back
This vector function is used to insert an item into a vector.
size
This vector function returns the number of elements in a vector.
pop_back
This vector function removes an item from a vector.
empty
This vector function returns true if the vector has no elements.
×

Hi there, would you like to get such a paper? How about receiving a customized one? Check it out