Chapter 7 C++

25 July 2022
4.7 (114 reviews)
28 test answers

Unlock all answers in this set

Unlock answers (24)
question
The individual values contained in array are known as:
answer
elements
question
A two-dimensional array can have elements of ________ data type(s).
answer
one
question
This vector function removes an item from a vector.
answer
pop_back
question
An array can store a group of values, but the values must be:
answer
the same data type
question
The statement int grades [ ] = { 100, 90, 99, 80}; show an example of:
answer
implicit array sizing
question
This vector function is used to insert an item into a vector.
answer
push_back
question
The ________ is automatically appended to a character array when it is initialized with a string constant.
answer
null terminator
question
Subscript numbering in C++
answer
begins with zero
question
An array of string objects that will hold 5 names would be declared using which statement?
answer
string names[5];
question
An array's size declarator must be a(n)________ with a value greater than ________.
answer
constant integer expression, zero
question
A two-dimensional array can be viewed as ________ and ________.
answer
rows, columns
question
By using the same ________ you can build relationships between data stored in two or more arrays.
answer
subscript
question
A two-dimensional array of characters can contain: 1) strings of the same length 2) strings of different lengths 3) uninitialized elements 4) All of these
answer
all of these
question
This vector function returns the number of elements in a vector.
answer
size
question
The name of an array stores the ________ of the first array element.
answer
memory address
question
An element of a two-dimensional array is referred to by ________ followed by ________.
answer
the row subscript of the element, the column subscript of the element
question
It is ________ to pass an argument to a function that contains an individual array element, such as numbers[3].
answer
legal in C++
question
An array can easily be stepped through by using a:
answer
for loop
question
A(n) ________ can be used to specify the starting values of an array.
answer
initialization list
question
If you leave out the size declarator in an array definition:
answer
you must furnish an initialization list
question
This vector function returns true if the vector has no elements.
answer
empty
question
What will the following code do? const int SIZE = 5 ; double x [ SIZE ]; for (int i=2; i <= SIZE; i ++) { x[i] = 0.0; }
answer
An error will occur when the code runs.
question
Which statement correctly defines a vector object for holding integers?
answer
vector v;
question
What does the following statement do? vector v(10, 2);
answer
It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
question
Which of the following is a valid C++ array definition?
answer
int scores [10];
question
To pass an array as an argument to a function, pass the ________ of the array.
answer
name
question
Unlike regular variables, these can hold multiple values
answer
arrays
question
A two-dimensional array is like ________ put together.
answer
several identical arrays