Monday, August 9, 2010

IndexOutOfRangeException Questions

1. What is the upperbound of the array?
2

2. How many elements are contained within the array?
3

3. How should this loop be primed? - that is - what do you suggest as a starting value and an ending value?
Starting Value = 0
Ending Value = 2

4. Why does the code in figure 4 produce an IndexOutOfRangeException?
It produces an Exception error because the Ending Value is equal to 3, this is outside the UpperBounds of the array.

5. What value is displayed in the message box when the loop is in it’s second iteration?
"String 2"

6. Post a screen shot of the message box produced in it’s second iteration.

No comments:

Post a Comment