Filters
Question type

Study Flashcards

A two-dimensional array is like ________ put together.


A) an array and a function
B) several identical arrays
C) two functions
D) two arrays of different types
E) None of these

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

Unlike regular variables, these can hold multiple values.


A) constants
B) named constants
C) arrays
D) floating-point variables
E) None of these

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

A(n) ________ can be used to specify the starting values of an array.


A) initialization list
B) array name
C) subscript
D) element
E) None of these

F) C) and E)
G) A) and E)

Correct Answer

verifed

verified

An element of a two-dimensional array is referred to by ________ followed by ________.


A) the array name, the column number of element
B) the row subscript of the element, the column subscript of the element
C) a comma, a semicolon
D) the row subscript of element, the array name
E) None of these

F) C) and D)
G) All of the above

Correct Answer

verifed

verified

A two-dimensional array can be viewed as ________ and ________.


A) rows, columns
B) arguments, parameters
C) increments, decrements
D) All of these
E) None of these

F) B) and D)
G) D) and E)

Correct Answer

verifed

verified

An array with no elements is ________.


A) legal in C++
B) illegal in C++
C) automatically furnished one element, with a value of zero
D) automatically furnished one value-the null terminator
E) None of these

F) B) and C)
G) A) and E)

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

True

Which statement correctly defines a vector object for holding integers?


A) vector v<int>;
B) int vector v;
C) int<vector> v;
D) vector<int> v;

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

D

To access an array element, use the array name and the element's ________.


A) data type
B) subscript
C) name
D) value
E) None of these

F) A) and E)
G) B) and C)

Correct Answer

verifed

verified

This vector function returns the number of elements in a vector.


A) size
B) num_elements
C) elements
D) length

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

The amount of memory used by an array depends upon the array's data type and the number of elements in the array.

A) True
B) False

Correct Answer

verifed

verified

It is ________ to pass an argument to a function that contains an individual array element, such as numbers[3].


A) illegal in C++
B) legal in C++
C) not recommended by the ANSI committee
D) not good programming practice
E) None of these

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

A vector object automatically expands in size to accommodate the items stored in it.

A) True
B) False

Correct Answer

verifed

verified

True

How many elements does the following array have? How many elements does the following array have?   A) 1000 B) 999 C) 1001 D) Cannot tell from the code


A) 1000
B) 999
C) 1001
D) Cannot tell from the code

E) B) and D)
F) A) and C)

Correct Answer

verifed

verified

An array can store a group of values, but the values must be:


A) the same data type
B) each of a different data type
C) constants
D) integers
E) None of these

F) A) and E)
G) B) and D)

Correct Answer

verifed

verified

Assume array1 and array2 are the names of arrays. To assign the contents of array2 to array1, you would use the following statement. array1 = array2;

A) True
B) False

Correct Answer

verifed

verified

The ________ is automatically appended to a character array when it is initialized with a string constant.


A) array name
B) number of elements
C) value of the first element
D) null terminator
E) None of these

F) A) and B)
G) A) and E)

Correct Answer

verifed

verified

This vector function removes an item from a vector.


A) remove_item
B) delete_item
C) erase
D) pop_back

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

What will the following code display? What will the following code display?   A)    B)    C)    D) Nothing. This code has an error.


A) What will the following code display?   A)    B)    C)    D) Nothing. This code has an error.
B) What will the following code display?   A)    B)    C)    D) Nothing. This code has an error.
C) What will the following code display?   A)    B)    C)    D) Nothing. This code has an error.
D) Nothing. This code has an error.

E) All of the above
F) C) and D)

Correct Answer

verifed

verified

To assign the contents of one array to another, you must use ________.


A) the assignment operator with the array names
B) the equality operator with the array names
C) a loop to assign the elements of one array to the other array
D) Any of these
E) None of these

F) C) and E)
G) A) and E)

Correct Answer

verifed

verified

Showing 1 - 20 of 58

Related Exams

Show Answer