Exam 8: Arrays

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

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

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

(True/False)
4.9/5
(69)

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

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

(Multiple Choice)
4.9/5
(79)

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? Cin)get(charArray, 51); Cin)get(discard);

(Multiple Choice)
4.8/5
(71)

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

(True/False)
5.0/5
(70)

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

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

(Multiple Choice)
4.9/5
(72)

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

(Multiple Choice)
5.0/5
(83)

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

(True/False)
4.8/5
(76)

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

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

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

(Multiple Choice)
4.8/5
(78)

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

In row order form, the ____.

(Multiple Choice)
4.9/5
(81)

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

(Multiple Choice)
4.9/5
(77)

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

(Short Answer)
4.7/5
(80)

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

(Short Answer)
4.8/5
(79)

Given the following declaration: Given the following declaration:   which of the following correctly finds the sum of the elements of the fourth column of sale? which of the following correctly finds the sum of the elements of the fourth column of sale?

(Multiple Choice)
4.8/5
(80)

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

(True/False)
4.9/5
(87)
Showing 21 - 40 of 40
close modal

Filters

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