Exam 7: Arrays

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

All arrays are objects of the base type ____ class.

(Multiple Choice)
4.9/5
(89)

Array elements are normally stored in contiguous, side-by-side, memory locations with the first index in all arrays being referenced by index 0.

(True/False)
4.9/5
(78)

Array.Copy(waterDepth, 2, w, 0, 5); The Copy( ) method, shown above, is a(n) ____________ method.

(Short Answer)
4.9/5
(79)

If you do not know the size of the array needed, you can create an array large enough to hold any number of entries and tell users to enter a predetermined sentinel value after they enter the last value. Using this approach:

(Multiple Choice)
4.8/5
(82)

All arrays, of any type, inherit characteristics from the ____________ class, which includes a number of predefined methods and properties.

(Short Answer)
5.0/5
(75)

double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4}; With the declaration above, price[2] refers to 2.2.

(True/False)
4.8/5
(79)

When you do a compile-time initialization of array elements, values are separated by ____________.

(Short Answer)
4.7/5
(74)

The first element of an array is always referenced by index ____________.

(Short Answer)
4.9/5
(83)

BinarySearch( ) is ____.

(Multiple Choice)
4.8/5
(69)

In C# the length of an array cannot be changed. After it is instantiated with a length, dynamic resizing is not an option.

(True/False)
4.8/5
(80)

Which loop structure can be used to change the contents of the array?

(Multiple Choice)
4.8/5
(69)

When you pass an array to a method, by default, a copy of each element in the array is made and passed to the method.

(True/False)
4.8/5
(78)

To create an array to hold the 5 numeric scores, you could write ____________.

(Short Answer)
5.0/5
(81)

The type used in the foreach expression must match the array type.

(True/False)
4.9/5
(87)

All data values placed in an array must be of the same ____________.

(Short Answer)
4.7/5
(84)

int [ ] anArray = new int [10]; Int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; How could all values of anotherArray be totaled?

(Multiple Choice)
4.7/5
(82)

Which of the following can be used to return an index of an item in an array?

(Multiple Choice)
4.7/5
(77)

Arrays are ____________ variables. The array identifier memory location does not actually contain the values, but instead stores an address indicating the location of the first element in the array.

(Short Answer)
4.8/5
(73)

There are several ways to do a compile-time initialization of arrays. All of the following are valid ways EXCEPT ____.

(Multiple Choice)
4.9/5
(78)

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

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

Filters

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