Exam 8: Arrays

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

Which of the following correctly declares name to be a character array and stores "William" in it?

(Multiple Choice)
4.9/5
(76)

The ____________________ of an array is the address (that is, the memory location) of the first array component.

(Short Answer)
4.9/5
(78)

Consider the following statement: double alpha[10][5];.The number of components of alpha is ____.

(Multiple Choice)
4.8/5
(80)

Consider the following declaration: char str[15];.Which of the following statements stores "Blue Sky" into str?

(Multiple Choice)
4.9/5
(84)

In row order form, the ____.

(Multiple Choice)
4.8/5
(78)

A collection of a fixed number of elements (called components) arranged in n dimensions (n >= 1) is called a(n) ____.

(Multiple Choice)
5.0/5
(76)

In a(n) ____________________ data type, each data item is a collection of other data items.

(Short Answer)
4.8/5
(80)

The array index can be any integer less than the array size.

(True/False)
4.9/5
(81)

Suppose that gamma is an array of 50 components of type int and j is an int variable.Which of the following for loops sets the index of gamma out of bounds?

(Multiple Choice)
4.9/5
(73)

Which of the following statements declares alpha to be an array of 25 components of the type int?

(Multiple Choice)
4.8/5
(78)

Suppose that list is an array of 10 components of type int.Which of the following codes correctly outputs all the elements of list?

(Multiple Choice)
4.9/5
(79)

In a two-dimensional array, the elements are arranged in a table form.

(True/False)
4.9/5
(89)

What is the value of alpha[2] after the following code executes? What is the value of alpha[2] after the following code executes?

(Multiple Choice)
4.7/5
(81)

Given the following declaration: Given the following declaration:   which of the following correctly finds the sum of the elements of the fifth row of sale? which of the following correctly finds the sum of the elements of the fifth row of sale?

(Multiple Choice)
4.8/5
(72)

Given the declaration int list[20]; the statement list[12] = list[5] + list[7]; updates the content of the twelfth component of the array list.

(True/False)
4.9/5
(74)

The word ____________________ is used before the array declaration in a function heading to prevent the function from modifying the array.

(Short Answer)
4.9/5
(74)

Suppose that sales is an array of 50 components of type double.Which of the following correctly initializes the array sales?

(Multiple Choice)
4.8/5
(71)

When you pass an array as a parameter, the base address of the actual array is passed to the formal parameter.

(True/False)
4.7/5
(65)

After the following statements execute, what are the contents of matrix? After the following statements execute, what are the contents of matrix?

(Multiple Choice)
4.9/5
(78)

Consider the following declaration: int alpha[5] = {3, 5, 7, 9, 11};.Which of the following is equivalent to this statement?

(Multiple Choice)
4.9/5
(74)
Showing 21 - 40 of 40
close modal

Filters

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