Exam 7: Arrays

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

With parallel arrays, the relationship is established through using the same subscript or index to refer to the elements in both arrays.

(True/False)
4.8/5
(87)

int [ ] anArray = new int [10]; Int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; AnotherArray.Length returns ____. ​

(Multiple Choice)
4.8/5
(79)

Given an array declaration of int anArray[1000], which of the following would be a valid call to a DisplayContents( ) method to send the full array into the method as an argument?

(Multiple Choice)
4.9/5
(88)

int [ ] score = {86, 66, 76, 92, 95, 88}; for (int i = score.Length-1; i > -1; i--) { Total += score[i]; } Using the declaration above for score, what is added to total during the first iteration?

(Multiple Choice)
4.7/5
(86)

If you do not know how many entries will be stored with the array, you could dimension it ____.

(Multiple Choice)
4.7/5
(95)

Arrays are reference variables.

(True/False)
4.8/5
(86)

Array identifiers are normally defined using a plural noun.

(True/False)
4.9/5
(90)

int [ ] anArray = new int [10]; int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; Foreach (int val in anotherArray) Total += val; Using the above declaration along with the foreach loop, what is stored in total after the program statements are executed?

(Multiple Choice)
4.9/5
(72)

Array identifiers are normally defined using a(n) ____________.

(Short Answer)
4.8/5
(77)

int [ ] anArray = new int [10]; Int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; Which of the following would copy all of the elements from anotherArray to anArray?

(Multiple Choice)
4.9/5
(75)

Which of the following could be a method heading for a member method that returns an array?

(Multiple Choice)
4.7/5
(89)

For an array that is dimensioned with a Length of 100, valid subscripts are 0 through 100.

(True/False)
4.8/5
(62)

To access an array element, you must specify which element is to be retrieved by placing an index inside ____________ following the array identifier

(Short Answer)
4.7/5
(67)

double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4}; Looking above, the value of price.Length is 5.

(True/False)
5.0/5
(98)

Given an array declaration of int anArray[1000], which of the following would be a valid heading for a method that sends the array in as a parameter?

(Multiple Choice)
4.7/5
(86)

When you pass a single array element such as an integer, you are passing by reference.

(True/False)
4.9/5
(101)

The Clear( ) method of the Array class sets all integer elements to zero.

(True/False)
4.8/5
(78)

Which of the following is a valid example of calling a method and sending it an array argument?

(Multiple Choice)
4.9/5
(86)

int [ ] anArray = new int[24]; For the above declaration, 25 cells are set aside for the array since the first element is referenced by index 0.

(True/False)
5.0/5
(75)

Arrays can be sent to methods as arguments, and methods can have arrays as their return type.

(True/False)
4.9/5
(88)
Showing 41 - 60 of 75
close modal

Filters

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