c# chapter 7 part 2
To declare and instantiate memory for 4 exam scores that range in value from 0 to 100, the following declaration could be made _______?
int [] examScore = new examScore[4];
The index is also referred to as the _____ of the array?
Subscript
All arrays are objects of the base type _____ class?
Array
Given an array declared to hold 100 values, the smallest index that can be used with the array is _______?
0
Given an array declared to hold 100 values, the largest index that can be used with the array is _____?
99
There are several ways to do a compile-time initialization of arrays. All of the following are valid ways EXCEPT _______?
nt [] anArray = new int [10] {100, 100, 100};
If an array named num is dimensioned to hold 10 values, how would you store 50 in the 5th physical location?
num[4] = 50;
If an array named num is dimensioned to hold 10 values, what happens if you write num[100] = 50;?
A runtime error will be generated
If you try to access the array using a negative index value, ____?
A runtime error will be generated
If you do not know how many entries will be stored with the array, you could dimension it ____?
large enough to hold the maximum number of entries
A limitation of the foreach loop structure when used with arrays is ____?
it offers read only access
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?
88
BinarySearch() is _______?
a method in the Array class
Which of the following could be a method heading for a member method that returns an array?
int [] DoSomething()
If an array is to be sent to a method, which of the following is a valid heading for a method?
void DisplayOutput(double [ ] anArray)
Which of the following is a valid example of calling a method and sending it an array argument?
DisplayArrayContents(anArray);
What happens when you assign one array to another using the assignment operator?
Both arrays reference the same memory locations