Deck 6: Using Arrays
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/40
العب
ملء الشاشة (f)
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) 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
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()
A) Reverse()
B) BinarySearch()
C) Order()
D) Sort()
D
4
When you instantiate an array, you can choose its location in memory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) a floating decimal value
B) a character value
C) an integer
D) a symbol
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
6
In C#, an array's elements are numbered beginning with 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
7
When you declare an object, what are the character fields set to?
A) ' '
B) false
C) 0
D) null
A) ' '
B) false
C) 0
D) null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
8
What operator is used for the purpose of creating objects in C#?
A) new
B) save
C) initialize
D) reserve
A) new
B) save
C) initialize
D) reserve
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) value specification
B) array specification
C) initializer list
D) array initializer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) for
B) while
C) do-while
D) foreach
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) sequential
B) parallel
C) binary
D) range match
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
13
Arrays are useful when you need to store just one value in memory at a time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
14
When you declare an object, what are the numeric fields initialized to?
A) null
B) '\u0000'
C) 0
D) false
A) null
B) '\u0000'
C) 0
D) false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) Array.Length - 2
B) Array.Length - 1
C) Array.Length
D) Array.Length + 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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()
A) Sort()
B) BinarySearch()
C) Reverse()
D) IndexOf()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
17
The power of arrays becomes apparent when you use subscripts that are variables rather than constant values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) int
B) float
C) double
D) boolean
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
19
When you declare an object, what are the bool fields initialized to?
A) null
B) false
C) true
D) '\u0000'
A) null
B) false
C) true
D) '\u0000'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
20
In C#, arrays are objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
21
Explain how to use a for loop to search an array for an exact match.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) two-dimensional
B) jagged
C) rectangular
D) single-dimensional
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) 1 byte
B) 8 bytes
C) 8 bits
D) 8 megabytes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
24
Describe the circumstances where you can use the foreach statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
25
How can you assign nondefault values to array elements when the array is declared? Give an example.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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()
A) BinarySearch()
B) Opposite()
C) Reverse()
D) Order()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
27
Briefly describe the Reverse() method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) twin array
B) shadow array
C) parallel array
D) shared array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
29
Under what circumstances does the BinarySearch() method prove inadequate?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
30
Explain how to use a for loop to perform an arithmetic operation on each element in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) 14
B) 15
C) 16
D) 17
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
32
Write a small program that uses the Sort() method to sort an array of names into alphabetical order.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) rectangular
B) matrix
C) jagged
D) table
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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()
A) List.Sort()
B) Collections.Sort()
C) Array.Sort()
D) Sort.Sort()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
35
How can you change the size of an array in C#?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
38
Explain how to assign a value to a specific array element and how to print it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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
A) vector
B) rectangular
C) list
D) linear
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck