Filters
Question type

Study Flashcards

An individual array element can be processed or passed to a function just like a regular C++ variable.

Correct Answer

verifed

verified

To step through a one- dimensional array, accessing the elements one by one, it would be most appropriate to use loop.


A) a nested loop
B) an infinite
C) no
D) a sentinel controlled loop
E) a for loop

Correct Answer

verifed

verified

The following statement adds a new element to a the department vector at index 25. The following statement adds a new element to a the <sup>department</sup><sup> </sup>vector at index 25.

Correct Answer

verifed

verified

When an array is passed to a function, it is actually _ the array that is/are passed.


A) the data type and size of
B) the value stored in the first element of
C) the starting memory address of
D) a copy of all the values in
E) none of the above

Correct Answer

verifed

verified

An element of a two- dimensional array is referenced by the array name and two subscripts, first the element row number and then the element column number.

Correct Answer

verifed

verified

If a C++ program contains the following array definition If a C++ program contains the following array definition

Correct Answer

verifed

verified

If the scores array is defined like this: If the <sup>scores</sup><sup> </sup>array is defined like this:   A) 7 B) 8 C) 4 D) 9 E) the first four scores


A) 7
B) 8
C) 4
D) 9
E) the first four scores

Correct Answer

verifed

verified

The amount of memory used by an array depends upon the array's data type and how many elements in the array currently have data stored in them.

Correct Answer

verifed

verified

C++ allows array elements to be class objects provided they are all instances of the same class.

Correct Answer

verifed

verified

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


A) all the same data type.
B) numeric, not characters or strings.
C) declared at the time the array is created.
D) constants.
E) none of the above.

Correct Answer

verifed

verified

To add up all the values in a two- dimensional array it would be best to use


A) one for loop
B) one sentinel controlled loop
C) two separate for loops
D) a nested for loop
E) no loop

Correct Answer

verifed

verified

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


A) value.
B) name.
C) data type.
D) size declarator.
E) subscript.

Correct Answer

verifed

verified

The following statement initializes all five elements of the number array to 1. The following statement initializes all five elements of the <sup>number</sup><sup> </sup>array to 1.

Correct Answer

verifed

verified

If you leave out the size declarator in an array declaration


A) the array will contain no elements.
B) the value of each array element is set to a default value of 0.
C) the array size defaults to 100 elements.
D) the array cannot be created.
E) you must furnish an initialization list.

Correct Answer

verifed

verified

When an array is passed to a function, it is actually the array that is passed.


A) the data type and name of
B) a copy of all the values in
C) the starting memory address of
D) the value stored in the first element of
E) the data type and size of

Correct Answer

verifed

verified

When you create a vector it is unnecessary to specify how many elements it will hold because it will expand in size as you add new values to it.

Correct Answer

verifed

verified

Each individual element of an array can be accessed by the array name and an element number, called a subscript.

Correct Answer

verifed

verified

Showing 21 - 37 of 37

Related Exams

Show Answer