Exam 7: Arrays

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Arrays may be ___________ at the time they are __________.

Free
(Multiple Choice)
4.8/5
(66)
Correct Answer:
Verified

C

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

Free
(Multiple Choice)
4.9/5
(81)
Correct Answer:
Verified

B

When writing functions that accept multi-dimensional arrays as arguments, _______________ must be explicitly stated in the parameter list.

Free
(Multiple Choice)
4.9/5
(77)
Correct Answer:
Verified

B

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

(True/False)
4.8/5
(78)

What does the following statement do? vector<int> v(10, 2);

(Multiple Choice)
4.8/5
(83)

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

(True/False)
4.9/5
(82)

What will the following code display? int numbers[] = { 99, 87, 66, 55, 101 }; for (int i = 1; i < 4; i++) \quad cout << numbers[i] << endl;

(Multiple Choice)
4.7/5
(69)

What will the following code display? int numbers[4] = { 99, 87 }; Cout << numbers[3] << endl;

(Multiple Choice)
4.9/5
(69)

This vector function is used to insert an item into a vector.

(Multiple Choice)
4.9/5
(80)

Which of the following is a valid C++ array definition?

(Multiple Choice)
4.7/5
(65)

A two-dimensional array is like ______________ put together.

(Multiple Choice)
4.9/5
(75)

An array can easily be stepped through by using a

(Multiple Choice)
4.8/5
(80)

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

(Multiple Choice)
4.8/5
(78)

When you pass an array as an argument to a function, the function can modify the contents of the array.

(True/False)
4.8/5
(91)

This vector function returns true if the vector has no elements.

(Multiple Choice)
4.9/5
(87)

The individual values contained in array are known as

(Multiple Choice)
5.0/5
(96)

What does the following statement do? vector<int> v(10);

(Multiple Choice)
4.8/5
(93)

What will the following code do? const int SIZE = 5; double x[SIZE]; for(int i = 2; i <= SIZE; i++) { \quad x[i] = 0.0; }

(Multiple Choice)
4.9/5
(70)

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

(Multiple Choice)
4.9/5
(79)

What is the last legal subscript that can be used with the following array? int values[5];

(Multiple Choice)
4.9/5
(71)
Showing 1 - 20 of 53
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)