Exam 8: Arrays

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

Given the following declaration:int j; int sum; Double sale[10][7]; Which of the following correctly finds the sum of the elements of the fourth column of sale?

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

D

Consider the following declaration:char charArray[51]; char discard; Assume that the input is:Hello There! How are you? What is the value of discard after the following statements execute? Consider the following declaration:char charArray[51]; char discard; Assume that the input is:Hello There! How are you? What is the value of discard after the following statements execute?

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

C

The one place where C++ allows aggregate operations on arrays is the input and output of C-strings.

Free
(True/False)
4.9/5
(82)
Correct Answer:
Verified

True

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

(True/False)
4.8/5
(76)

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

(Multiple Choice)
4.9/5
(85)

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

(Multiple Choice)
4.7/5
(71)

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.8/5
(72)

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

(Multiple Choice)
4.9/5
(81)

Assume you have the following declaration char nameList[100];.Which of the following ranges is valid for the index of the array nameList?

(Multiple Choice)
4.9/5
(73)

Assume you have the following declaration int beta[50];.Which of the following is a valid element of beta?

(Multiple Choice)
4.8/5
(91)

The form of the for loop shown below is called a(n) ____________________ for loop. for (dataType identifier : arrayName) statements ​

(Short Answer)
4.8/5
(89)

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

(Multiple Choice)
4.7/5
(83)

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

(True/False)
4.7/5
(73)

All components of an array are of the same data type.

(True/False)
4.7/5
(64)

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

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

(Multiple Choice)
4.8/5
(74)

In C++, the null character is represented as ____.

(Multiple Choice)
4.9/5
(66)

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

Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the component type int?

(Multiple Choice)
4.8/5
(73)

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

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

Filters

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