Chapters 6 and 7-- C++ Computer Programming

a function
A collection of statements that perform a specific task.
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.
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:
Functions are ideal for use in menu-driven programs. When a user selects a menu item, the program _____ the appropriate function.
This type of variable is defined inside a function and is not accessible outside the function.
The value in this type of local variable persists between function calls.
These types of arguments are passed to parameters automatically if no argument is provided in the function call.
When used as parameters, these types of variables allow a function to access the parameter’s original argument.
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.
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.
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.
A _____ argument is passed to a parameter when the actual argument is left out of the function call.
If a function does not have a prototype, default arguments may be specified in the function _____.
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.
This is a dummy function that is called instead of the actual function it represents.
Look at the following function prototype:

int myFunction(double);

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

Look at the following function prototype:

int myFunction(double);

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

A function _____ eliminates the need to place a function definition before all calls to the function
A _____ variable is declared outside all functions.
The individual values contained in an array are known as _____.
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:
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};

To access an array element, use the array name and the element’s _____.
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 _____.
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?
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?
This vector function is used to insert an item into a vector.
This vector function returns the number of elements in a vector.
This vector function removes an item from a vector.
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