Deck 6: Using Arrays

Full screen (f)
exit full mode
Question
With the foreach statement, what is used to automatically hold each array value through each iteration of the loop?

A) iteration variable
B) index holder
C) subscript holder
D) iteration holder
Use Space or
up arrow
down arrow
to flip the card.
Question
What can be used to distinguish each element from the others in an array?

A) an element operator
B) an object location
C) an element ID
D) a subscript
Question
What C# method should you use in order to arrange an array in ascending order?

A) Reverse()
B) BinarySearch()
C) Order()
D) Sort()
Question
When you instantiate an array, you can choose its location in memory.
Question
In C#, what must an array subscript be?

A) a floating decimal value
B) a character value
C) an integer
D) a symbol
Question
In C#, an array's elements are numbered beginning with 1.
Question
When you declare an object, what are the character fields set to?

A) ' '
B) false
C) 0
D) null
Question
What operator is used for the purpose of creating objects in C#?

A) new
B) save
C) initialize
D) reserve
Question
What can you use to assign a list of nondefault values to array elements at declaration?

A) value specification
B) array specification
C) initializer list
D) array initializer
Question
What statement, supported by C#, allows you to cycle through every array element without using a subscript?

A) for
B) while
C) do-while
D) foreach
Question
What type of search is performed when each array element is examined in order?

A) sequential
B) parallel
C) binary
D) range match
Question
Given an array that has many possible matches of a search value, what is the most efficient strategy for placement of items?

A) The items should be sorted in ascending order.
B) The items should be sorted in descending order.
C) The items should be randomly sorted.
D) The items should be sorted with the most common items first.
Question
Arrays are useful when you need to store just one value in memory at a time.
Question
When you declare an object, what are the numeric fields initialized to?

A) null
B) '\u0000'
C) 0
D) false
Question
Navigation through an entire array using a for or while loop can be done by varying a subscript from 0 to what value?

A) Array.Length - 2
B) Array.Length - 1
C) Array.Length
D) Array.Length + 1
Question
What method can be used to find the array position of a requested value in an array by repeatedly splitting the list of objects until a match is found, but only if the array is sorted in ascending order?

A) Sort()
B) BinarySearch()
C) Reverse()
D) IndexOf()
Question
The power of arrays becomes apparent when you use subscripts that are variables rather than constant values.
Question
An array subscript can be an expression, but only as long as the expression evaluates to what type?

A) int
B) float
C) double
D) boolean
Question
When you declare an object, what are the bool fields initialized to?

A) null
B) false
C) true
D) '\u0000'
Question
In C#, arrays are objects.
Question
Explain how to use a for loop to search an array for an exact match.
Question
An array that you can picture as a column of values, and whose elements you can access using a single subscript, is what type of array?

A) two-dimensional
B) jagged
C) rectangular
D) single-dimensional
Question
When an array is initialized with the double keyword, how large is each element of the array?

A) 1 byte
B) 8 bytes
C) 8 bits
D) 8 megabytes
Question
Describe the circumstances where you can use the foreach statement.
Question
How can you assign nondefault values to array elements when the array is declared? Give an example.
Question
What method does not sort array elements, but rather rearranges their positions to the opposite order?

A) BinarySearch()
B) Opposite()
C) Reverse()
D) Order()
Question
Briefly describe the Reverse() method.
Question
What type of array has the same number of elements and corresponding data with another array?

A) twin array
B) shadow array
C) parallel array
D) shared array
Question
Under what circumstances does the BinarySearch() method prove inadequate?
Question
Explain how to use a for loop to perform an arithmetic operation on each element in an array.
Question
What will be the highest subscript value possible for an array with 15 elements?

A) 14
B) 15
C) 16
D) 17
Question
Write a small program that uses the Sort() method to sort an array of names into alphabetical order.
Question
What type of one-dimensional array contains another one-dimensional array in each element, with each array capable of being a different length?

A) rectangular
B) matrix
C) jagged
D) table
Question
In order to use the Sort() method, what must the array name be passed to?

A) List.Sort()
B) Collections.Sort()
C) Array.Sort()
D) Sort.Sort()
Question
How can you change the size of an array in C#?
Question
How can the Array methods such as BinarySearch() and Sort() be used without constantly referencing the Array class name?

A) Issue a using static System.Array(); statement.
B) Add include Array.*; to the beginning of your program.
C) Issue a using class Array; statement.
D) Place a copy of the System.dll file in your project.
Question
Describe the main characteristics of two-dimensional arrays.How do you access an element in a two-dimensional array? What are some synonyms for a two-dimensional array?
Question
Explain how to assign a value to a specific array element and how to print it.
Question
What type of array utilizes the same number of columns in each row?

A) vector
B) rectangular
C) list
D) linear
Question
When using an array in a GUI program, if array values will change based on user input, where must the array be stored?

A) It must be stored inside the method that processes the user's events.
B) It must be stored inside an event handler.
C) It must be stored outside the method that processes the user's events.
D) It must be stored outside of the main program.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 6: Using Arrays
1
With the foreach statement, what is used to automatically hold each array value through each iteration of the loop?

A) iteration variable
B) index holder
C) subscript holder
D) iteration holder
A
2
What can be used to distinguish each element from the others in an array?

A) an element operator
B) an object location
C) an element ID
D) a subscript
D
3
What C# method should you use in order to arrange an array in ascending order?

A) Reverse()
B) BinarySearch()
C) Order()
D) Sort()
D
4
When you instantiate an array, you can choose its location in memory.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
5
In C#, what must an array subscript be?

A) a floating decimal value
B) a character value
C) an integer
D) a symbol
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
6
In C#, an array's elements are numbered beginning with 1.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
7
When you declare an object, what are the character fields set to?

A) ' '
B) false
C) 0
D) null
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
8
What operator is used for the purpose of creating objects in C#?

A) new
B) save
C) initialize
D) reserve
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
9
What can you use to assign a list of nondefault values to array elements at declaration?

A) value specification
B) array specification
C) initializer list
D) array initializer
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
10
What statement, supported by C#, allows you to cycle through every array element without using a subscript?

A) for
B) while
C) do-while
D) foreach
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
11
What type of search is performed when each array element is examined in order?

A) sequential
B) parallel
C) binary
D) range match
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
Given an array that has many possible matches of a search value, what is the most efficient strategy for placement of items?

A) The items should be sorted in ascending order.
B) The items should be sorted in descending order.
C) The items should be randomly sorted.
D) The items should be sorted with the most common items first.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
Arrays are useful when you need to store just one value in memory at a time.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
14
When you declare an object, what are the numeric fields initialized to?

A) null
B) '\u0000'
C) 0
D) false
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
Navigation through an entire array using a for or while loop can be done by varying a subscript from 0 to what value?

A) Array.Length - 2
B) Array.Length - 1
C) Array.Length
D) Array.Length + 1
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
16
What method can be used to find the array position of a requested value in an array by repeatedly splitting the list of objects until a match is found, but only if the array is sorted in ascending order?

A) Sort()
B) BinarySearch()
C) Reverse()
D) IndexOf()
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
17
The power of arrays becomes apparent when you use subscripts that are variables rather than constant values.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
An array subscript can be an expression, but only as long as the expression evaluates to what type?

A) int
B) float
C) double
D) boolean
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
19
When you declare an object, what are the bool fields initialized to?

A) null
B) false
C) true
D) '\u0000'
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
20
In C#, arrays are objects.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
21
Explain how to use a for loop to search an array for an exact match.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
22
An array that you can picture as a column of values, and whose elements you can access using a single subscript, is what type of array?

A) two-dimensional
B) jagged
C) rectangular
D) single-dimensional
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
23
When an array is initialized with the double keyword, how large is each element of the array?

A) 1 byte
B) 8 bytes
C) 8 bits
D) 8 megabytes
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
24
Describe the circumstances where you can use the foreach statement.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
25
How can you assign nondefault values to array elements when the array is declared? Give an example.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
26
What method does not sort array elements, but rather rearranges their positions to the opposite order?

A) BinarySearch()
B) Opposite()
C) Reverse()
D) Order()
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
27
Briefly describe the Reverse() method.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
28
What type of array has the same number of elements and corresponding data with another array?

A) twin array
B) shadow array
C) parallel array
D) shared array
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
29
Under what circumstances does the BinarySearch() method prove inadequate?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
30
Explain how to use a for loop to perform an arithmetic operation on each element in an array.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
31
What will be the highest subscript value possible for an array with 15 elements?

A) 14
B) 15
C) 16
D) 17
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
32
Write a small program that uses the Sort() method to sort an array of names into alphabetical order.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
33
What type of one-dimensional array contains another one-dimensional array in each element, with each array capable of being a different length?

A) rectangular
B) matrix
C) jagged
D) table
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
34
In order to use the Sort() method, what must the array name be passed to?

A) List.Sort()
B) Collections.Sort()
C) Array.Sort()
D) Sort.Sort()
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
35
How can you change the size of an array in C#?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
36
How can the Array methods such as BinarySearch() and Sort() be used without constantly referencing the Array class name?

A) Issue a using static System.Array(); statement.
B) Add include Array.*; to the beginning of your program.
C) Issue a using class Array; statement.
D) Place a copy of the System.dll file in your project.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
37
Describe the main characteristics of two-dimensional arrays.How do you access an element in a two-dimensional array? What are some synonyms for a two-dimensional array?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
38
Explain how to assign a value to a specific array element and how to print it.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
39
What type of array utilizes the same number of columns in each row?

A) vector
B) rectangular
C) list
D) linear
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
40
When using an array in a GUI program, if array values will change based on user input, where must the array be stored?

A) It must be stored inside the method that processes the user's events.
B) It must be stored inside an event handler.
C) It must be stored outside the method that processes the user's events.
D) It must be stored outside of the main program.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 40 flashcards in this deck.