c# chapter 8 part 2
how would you store 50 in the first physical row and first physical column?
num[ 0 , 0 ] = 50;
For a two-dimensional array, values are stored ____________ using a row major format?
side by side in contiguous memory locations
string sValue = "Life is about choices";
string [ ] sn = sValue.Split(' ');?
After the above segment of code is executed, where is "choices" stored?
sn[3]
The Length property can be used to return the total number of elements in all dimensions?
True or False?
True
The foreach loop structure cannot be used to iterate through a multi-dimensional array?
True or False
False
Strings are considered ____________ because once you give a string a value; it cannot be modified. Methods that seem to be modifying a string are actually returning a new string containing the modification?
immutable
Which of the following is a valid heading for a method that could accept the two-dimensional array as an argument?
void DisplayOutput(double [ , ] anArray)
Which of the following would define a two dimensional structure to store temperature during three periods of a day for seven days?
int [ , ] temp = new int [7, 3];
Console.WriteLine(calories.GetUpperBound(0)); returns the largest value in an array?
True or False?
False
In C#, the string type allows individual characters to be accessed using a(n) ____________ with the [ ]?
index
To declare a three-dimensional array, three integral values are used. The first number specifies the number of ____________?
planes
One of the special properties in the ArrayList class is Count. It returns ____?
an int representing the number of values currently stored in the array
Collection classes are classes that enable you to store and retrieve various groups of objects?
True or False?
True
For a declaration such as, int [ , ] anArray = new int [6, 5], a total of 11 memory locations can be accessed using the identifier anArray?
True or False?
False
The Rank property is used with array collections to return the number of dimensions?
True or False?
True
Multi-dimensional array identifiers are normally defined using a plural noun?
True or False?
False
The method that deletes a number of characters beginning at a specified position is ____?
Remove( )
____________ class represents a simple last-in-first-out (LIFO) collection of objects?
Stack
As with the ArrayList class, in order to instantiate objects of many of the collection classes, you need to include a using ____________?
System.Collections
The ____ method adds an object to the end of the queue?
Enqueue( )
Which of the following is an example of a collection class?
HashTable
all of the above
Queue
Array
all of the above
There are several ways to do a compile-time initialization of two-dimensional arrays. All of the following are valid ways EXCEPT ____?
int [ ] anArray = new int [10 ] {{100, 100, 100} {100, 100, 100}};
nt [ , ] score = {{88, 66, 76, 92, 95} {67, 88, 45, 99, 80}};
int total = 0;
foreach (int val in score)
total += val;
Using the code shown above, what is added to total during the first iteration?
88
string sValue = "Life is about choices";
string [ ] sn = sValue.Split(' ');
Using the Substring( ) method with sValue, which of the following references the word choices?
sValue.Substring(14, 7);
Console.Write("anExample".IndexOf("a")); returns ____?
0
Which method in the string class might be useful to create a table with values number aligned?
PadLeft( )
The method ____ of the ArrayList class returns an arraylist that is a subset of another arraylist?
GetRange( )
If you override the GetHashCode( ) method, you must also override the ____________ method to guarantee that two objects considered equal have the same hash code. Both are inherited from the object class?
Equals( )
Which of the following is a valid example of calling a method and sending it a two-dimensional array argument?
DisplayArrayContents(anArray);
Like traditional arrays, indexes of ArrayList objects are ____________?
zero based
Which of the following segments of code will display the first row of a two dimensional array?
for (int i = 0; i Console.Write(anArray[0, i] + "\t");
The ____________ method is used with the ArrayList class to push items on the list?
Add( )
C# has two types of string literals. Quoted string literals appear between double quotation marks (" ") and verbatim string literal, which start with the at symbol (@)?
True or False?
True
Which of the following returns the number of columns in a two-dimensional array?
GetLength(1)
The method in the string class that returns the string in uppercase is ____?
ToUpper( )
____ are types of data structures that consist of a sequence of data records such that in each record there is an additional field that contains a reference (i.e., a link) to the next record in the sequence.
Linked lists