Doyle: C#, 5th edition Page 1-1
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 8
1. d. columns
2. d. int [ , ] temp = new temp [7, 2];
7. d. g
8. a. all have the same type
9. e. none of the above
Doyle: C#, 5th edition Page 1-2
17. c. a copy of the value in the element of the ArrayList
18. b. the address of the ArrayList
23. a. Write(result(anArray, 3));
24. a. only be used for read-only access
b. string [ ] stringArray = sValue.Split(‘ ‘);
c. stringArray[stringArray.Length – 1] = stringArray[stringArray.Length
1].Remove(stringArray[stringArray.Length – 1].Length – 1, 1);
Doyle: C#, 5th edition Page 1-3
27. a. 10
b. 11
28. a. foreach(int ar in cArray)
{
b.
for(int r = 0; r<cArray.GetLength(0); r ++)
{
Doyle: C#, 5th edition Page 1-4
{
}
d. No, foreach is used for read only access.
29. Create array declarations for the following problem specifications.
a. string [ , ] stateName = new string[5,3] {{“Miami”, “Jacksonville”, “Orlando”},
{“Knoxville”, “Nashville”,
b. string [, ] name = new string [10, 2];
c. bool [, ] examKey = new bool[5, 15];
Doyle: C#, 5th edition Page 1-5
30. The Dictionary class has better performance than a HashTable for value types such as