Exam 8: Arrays

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

What is the output of the following C++ code? What is the output of the following C++ code?

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

C

Assume you have the following declaration double salesData[1000];. Which of the following ranges is valid for the index of the array salesData?

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

A

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

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

C

Arrays can be passed as parameters to a function by value, but it is faster to pass them by reference.

(True/False)
4.9/5
(89)

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

(Multiple Choice)
5.0/5
(66)

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

(Multiple Choice)
4.8/5
(80)

Consider the following statement: int alpha[25][10];. Which of the following statements about alpha is true?

(Multiple Choice)
4.7/5
(71)

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

(Short Answer)
4.9/5
(79)

If an array index goes out of bounds, the program always terminates in an error.

(True/False)
4.9/5
(77)

What is the output of the following C++ code? What is the output of the following C++ code?

(Multiple Choice)
4.8/5
(85)

The statement int list[25]; declares list to be an array of 26 components, since the array index starts at 0.

(True/False)
5.0/5
(80)

Suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list. Suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list.

(True/False)
4.9/5
(101)

For a list of length n, the ____________________ sort makes exactly (n(n - 1))/2 key comparisons and 3(n - 1) item assignments.

(Short Answer)
4.8/5
(80)

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

(Multiple Choice)
4.8/5
(84)

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

(Short Answer)
4.9/5
(73)

Consider the statement int list[10][8];. Which of the following about list is true?

(Multiple Choice)
4.8/5
(85)

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

(Multiple Choice)
4.8/5
(89)

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
(79)

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.9/5
(92)

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

(Multiple Choice)
4.9/5
(83)
Showing 1 - 20 of 40
close modal

Filters

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