Quiz 7 C++

The correct answer is: arrays
Unlike regular variables, these can hold multiple values.
The correct answer is: elements
The individual values contained in array are known as ________.
We will write a custom essay sample on
Quiz 7 C++
or any similar topic only for you
Order now
The correct answer is: subscript
To access an array element, use the array name and the element’s ________.
The correct answer is: int array[10];
Which of the following is a valid C++ array definition?
The correct answer is: implicit array sizing
The statement:

int grades [] = {100, 90, 99, 80};

shows an example of:

The correct answer is: subscript
By using the same ________ you can build relationships between data stored in two or more arrays.
The correct answer is: memory address
The name of an array stores the ________ of the first array element.
The correct answer is: several identical arrays
A two-dimensional array is like ________ put together.
The correct answer is: rows, columns
A two-dimensional array can be viewed as ________ and ________.
The correct answer is: you must furnish an initialization list
If you leave out the size declarator in an array definition:
The correct answer is: int scores [10];
Which of the following is a valid C++ array definition?
The correct answer is: the row subscript of the element, the column subscript of the element
An element of a two-dimensional array is referred to by ________ followed by ________.
The correct answer is: all but the first dimension
When writing functions that accept multi-dimensional arrays as arguments, ________ must be explicitly stated in the parameter list.
The correct answer is: the same data type
An array can store a group of values, but the values must be:
The correct answer is: constant integer expression, zero
An array’s size declarator must be a ________ with a value greater than ________.
The correct answer is: begins with zero
Subscript numbering in C++________.
The correct answer is: initialized, declared
Arrays may be ________ at the time they are ________.
The correct answer is: scores[2]
Given the following declaration, where is the value 77 stored in the scores array?
The correct answer is: for loop
An array can easily be stepped through by using a ________.
The correct answer is: range variable
The range-based for loop, in C++ 11, is designed to work with a built-in variable known as the ________.
The correct answer is: a loop to assign the elements of one array to the other array
To assign the contents of one array to another, you must use ________.
The correct answer is: name
To pass an array as an argument to a function, pass the ________ of the array.
The correct answer is: one
A two-dimensional array can have elements of ________ data type(s).
The correct answer is: All of these
A two-dimensional array of characters can contain ________.
The correct answer is: initialization list
ANo ________ can be used to specify the starting values of an array.
The correct answer is: null terminator
The ________ is automatically appended to a character array when it is initialized with a string constant.
The correct answer is: illegal in C++
An array with no elements is ________.
The correct answer is: string names[5];
An array of string objects that will hold 5 names would be declared using which statement?
The correct answer is: legal in C++
It is ________ to pass an argument to a function that contains an individual array element, such as numbers[3].
The correct answer is: 4
What is the last legal subscript that can be used with the following array?
The correct answer is: 1000
How many elements does the following array have?
The correct answer is: 55
What will the following code display?
The correct answer is: 87
66
55
What will the following code display?
The correct answer is: 0
What will the following code display?
The correct answer is: An error will occur when the code runs
What will the following code do?
The correct answer is: vector v;
Which statement correctly defines a vector object for holding integers?
The correct answer is: vector n { 10, 20 };
Which statement correctly uses C++ 11 to initialize a vector of ints named n with the values 10 and 20?
The correct answer is: It creates a vector object with a starting size of 10.
What does the following statement do?
The correct answer is: 3
5
What will the following C++ 11 code display?
The correct answer is: It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
What does the following statement do?
The correct answer is: push_back
This vector function is used to insert an item into a vector.
The correct answer is: size
This vector function returns the number of elements in a vector.
The correct answer is: pop_back
This vector function removes an item from a vector.
The correct answer is: empty
This vector function returns true if the vector has no elements.
The correct answer is ‘True’.
True/False: The amount of memory used by an array depends upon the array’s data type and the number of elements in the array.
The correct answer is ‘False’.
True/False: An array initialization list must be placed on one single line.
The correct answer is ‘True’.
True/False: When you pass an array as an argument to a function, the function can modify the contents of the array.
The correct answer is ‘False’.
True/False: If you attempt to store data past an array’s boundaries, it is guaranteed that the compiler will issue an error.
The correct answer is ‘True’.
True/False: In C++ 11, you cannot use a range-based for loop to modify the contents of an array unless you declare the range variable as a reference.
The correct answer is ‘False’.
True/False: Although two-dimensional arrays are a novel idea, there is no known way to pass one to a function.
×

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