Deck 9: Arrays
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/57
العب
ملء الشاشة (f)
Deck 9: Arrays
1
An advantage of using the For Each…Next statement to process an array is that your code does not need to keep track of the array subscripts or even know the number of array elements.
True
2
Which of the following correctly shows the syntax for storing data in a one-dimensional array? 

B
3
Storing data in an array decreases the efficiency of your code.
False
4
The data used to initialize the elements of an array is enclosed in ____.
A) [ ]
B) { }
C) ( )
D) " "
A) [ ]
B) { }
C) ( )
D) " "
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
5
If the array's data type is Integer,each element in the array is initialized using the keyword Nothing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
6
A simple variable is unrelated to any other variable in memory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
7
An array is defined as follows: Dim numbers(3)As Integer
How many elements does the array have?
A) one
B) two
C) three
D) four
How many elements does the array have?
A) one
B) two
C) three
D) four
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
8
The data in a two-dimensional array are not required to have the same data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
9
A(n)____ is a group of variables that have the same name and data type,and are related in some way.
A) subscript
B) string
C) array
D) run time error
A) subscript
B) string
C) array
D) run time error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
10
When an array is sorted in descending order,the first element in the array contains the smallest value and the last element contains the largest value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
11
Before you can use an array,you first must declare it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
12
The following statement will declare an array.What is the index value for the first element? Dim lakes(5)
A) 0
B) 1
C) 4
D) 5
A) 0
B) 1
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
13
If a one-dimensional array contains five elements,its highest subscript is ____.
A) 4
B) 5
C) 6
D) 7
A) 4
B) 5
C) 6
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
14
The statement ____ assigns the string "Madrid" to the first element in the strCities array.
A) strCities(0)= Madrid
B) strCities(0)= "Madrid"
C) strCities(1)= Madrid
D) strCities(0)= {Madrid}
A) strCities(0)= Madrid
B) strCities(0)= "Madrid"
C) strCities(1)= Madrid
D) strCities(0)= {Madrid}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
15
Assigning initial values to an array is often referred to as ____.
A) sorting the array
B) populating the array
C) assigning the array
D) declaring the array
A) sorting the array
B) populating the array
C) assigning the array
D) declaring the array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
16
When a run time error occurs,the computer displays an error message and the application ends abruptly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
17
The following statement will declare an array that has ____ elements. Dim lakes(5)As Integer
A) four
B) five
C) six
D) seven
A) four
B) five
C) six
D) seven
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
18
If a one-dimensional array contains five elements,its Length property contains the number 5 but its highest subscript is 3.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
19
A two-dimensional array resembles a table in that the variables (elements)are in rows and columns.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
20
An array called state()is loaded as follows: Dim state()As String = {"Ohio","Michigan","California","Arizona"}
What is the value of the subscript used to reference "Arizona"?
A) 1
B) 2
C) 3
D) 4
What is the value of the subscript used to reference "Arizona"?
A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
21
Based on the code below,intScores(0,0)is initialized to ____. 
A) 9
B) 25
C) 75
D) 90

A) 9
B) 25
C) 75
D) 90
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
22
You do not need to specify the highest array subscript in the ____ statement.
A) Do...Loop
B) For...Next
C) For Each...Next
D) While...Wend
A) Do...Loop
B) For...Next
C) For Each...Next
D) While...Wend
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
23
Consider the following array:
What value will the following expression yield for total?

A) 4
B) 6
C) 8
D) 12


A) 4
B) 6
C) 8
D) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
24
Based on the statement below,which of the following If clauses determines whether the intSub variable contains a valid subscript for the array? 

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
25
Consider the following array:
What row index value would be required to create this two-dimensional array?
A) 2
B) 3
C) 4
D) 5

A) 2
B) 3
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
26
The syntax ____ assigns either the value entered in the txtSales control (converted to Decimal)or the number 0 to the third element in the decSales array. 

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following statements declares a class-level one-dimensional array named strToppings that stores the 14 available pizza toppings?
A) Dim strToppings(13)As String
B) Private strToppings(13)As String
C) Dim strToppings(14)As String
D) Private strToppings(14)As String
A) Dim strToppings(13)As String
B) Private strToppings(13)As String
C) Dim strToppings(14)As String
D) Private strToppings(14)As String
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
28
The strRoom and strRate arrays are parallel arrays.If Deluxe is stored in the third element in the strRoom array,where is its rate (115)stored?
A) strRate(0)
B) strRate(1)
C) strRate(2)
D) strRate(3)
A) strRate(0)
B) strRate(1)
C) strRate(2)
D) strRate(3)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
29
The statement ____ assigns the string "Paris" to the element located in the first row,second column in the strCities array.
A) strCities(1,1)= {Paris}
B) strCities(0,1)= "Paris"
C) strCities(0,0)= (Paris)
D) strCities(1,0)= "Paris"
A) strCities(1,1)= {Paris}
B) strCities(0,1)= "Paris"
C) strCities(0,0)= (Paris)
D) strCities(1,0)= "Paris"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
30
Using an invalid subscript will result in a ____.
A) run time error
B) breakpoint
C) logic error
D) design-time error
A) run time error
B) breakpoint
C) logic error
D) design-time error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
31
Two or more arrays whose elements are related by their positions in the arrays are referred to as ____ arrays.
A) parallel
B) two-dimensional
C) accumulator
D) related
A) parallel
B) two-dimensional
C) accumulator
D) related
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
32
Based on the code below,intScores(3,1)is initialized to ____. 
A) 6
B) 12
C) 23
D) 56

A) 6
B) 12
C) 23
D) 56
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
33
Based on the code below,intScores(2,0)is initialized to ____. 
A) 25
B) 23
C) 56
D) 75

A) 25
B) 23
C) 56
D) 75
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
34
To refer to the element located in the first row,first column in a two-dimensional array named strProducts,you use ____.
A) strProducts(0,0)
B) strProducts{0,1}
C) strProducts(1,1)
D) strProducts[0,0]
A) strProducts(0,0)
B) strProducts{0,1}
C) strProducts(1,1)
D) strProducts[0,0]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
35
To arrange the elements in an array in ascending order,you use the ____ method.
A) Array.Arrange
B) Array.Ascending
C) Array.Sort
D) Array.Arrange
A) Array.Arrange
B) Array.Ascending
C) Array.Sort
D) Array.Arrange
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
36
The intSub variable keeps track of array subscripts and is initialized to 0.The intHighSub variable contains the highest subscript for the strToppings array.Which of the following statements will traverse the strToppings array?
A) Do While intSub >= intHighSub
B) For intHighSub As Integer = 0 To intSub
C) Do While intSub <= intHighSub
D) For intSub As Integer = 1 To intHighSub
A) Do While intSub >= intHighSub
B) For intHighSub As Integer = 0 To intSub
C) Do While intSub <= intHighSub
D) For intSub As Integer = 1 To intHighSub
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
37
Based on the code below,intScores(2,1)is initialized to ____. 
A) 25
B) 23
C) 56
D) 75

A) 25
B) 23
C) 56
D) 75
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
38
Based on the code below,intScores(3,0)is initialized to ____. 
A) 6
B) 12
C) 23
D) 56

A) 6
B) 12
C) 23
D) 56
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
39
Based on the code below,intScores(1,1)is initialized to ____. 
A) 9
B) 25
C) 75
D) 90

A) 9
B) 25
C) 75
D) 90
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
40
An array's ____ method returns an integer that indicates the highest subscript in the specified dimension in the array.
A) Sort
B) Reverse
C) TryParse
D) GetUpperBound
A) Sort
B) Reverse
C) TryParse
D) GetUpperBound
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
41
How do the elements in parallel one-dimensional arrays relate to each other? Provide an example.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
42
Write the statement to declare a four-element procedure-level array named intNum with each element initialized to 0.Then write the statements necessary to add the number 5 to each element in the intNum array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
43
Write the statement to declare a seven-element procedure-level array named strItemCode with each element initialized to the keyword Nothing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
44
Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a For Each...Next statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
45
Which of the following statements assigns the daily special of lasagna to Tuesday?
A) strDailySpecial(3,2)= lasagna
B) strDailySpecial(3,2)= "Tuesday"
C) strDailySpecial(2,1)= "lasagna"
D) strDailySpecial(3,2)= "lasagna"
A) strDailySpecial(3,2)= lasagna
B) strDailySpecial(3,2)= "Tuesday"
C) strDailySpecial(2,1)= "lasagna"
D) strDailySpecial(3,2)= "lasagna"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
46
You have decided the Daily "Chef's Specials" need to be stored in a two-dimensional array rather than two parallel one-dimensional arrays.Which of the following statements will declare the array as a procedure-level array named strDailySpecial? The number of rows is based on the number of days in the week,and Sunday remains the first element for the days of the week.
A) Dim strDailySpecial(6,1)As String
B) Dim strDailySpecial(7,2)As String
C) Dim strDailySpecial(1,6)As String
D) Dim strDailySpecial(2,7)As String
A) Dim strDailySpecial(6,1)As String
B) Dim strDailySpecial(7,2)As String
C) Dim strDailySpecial(1,6)As String
D) Dim strDailySpecial(2,7)As String
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
47
Write the statement to declare a five-element procedure-level array named decGPA,and initialize the array with the following values: 2.58,3.85,3.6,1.45,2.75.Then write a statement to assign the number 2.55 to the last element in the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
48
Daily "Chef's Specials" are stored using two one-dimensional parallel arrays.The days of the week are stored in the strDays array,with Sunday as the first element.The daily special for each day is stored in a parallel array named strSpecial.Which of the following statements assigns Friday's special,which is rigatoni,to the appropriate element?
A) strSpecial(6)= rigatoni
B) strSpecial(5)= rigatoni
C) strSpecial(6)= "rigatoni"
D) strSpecial(5)= "rigatoni"
A) strSpecial(6)= rigatoni
B) strSpecial(5)= rigatoni
C) strSpecial(6)= "rigatoni"
D) strSpecial(5)= "rigatoni"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
49
The following array is declared and initialized:


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
50
Write the statement that assigns the string "Treasurer" to the element located in the third row,second column in the strOfficers array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
51
The following array is declared and initialized:
Write the statements to sort the values in the array in descending order.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
52
Write the statement to declare a procedure-level two-dimensional array named dblRates using the following table of data:


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
53
Write the statement that assigns the length of the strBooks array to the intNumElements variable.Then write the statement that assigns the highest subscript in the array to the intHighestSub variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
54
Explain the difference between a simple variable and an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
55
Write the statement to declare a six-element class-level array named strAnimal,and initialize the array with the following values: dog,cat,mouse,bird,snake,fish.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
56
Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a Do...Loop statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
57
Write the statement to declare a twelve-row,two-column procedure-level array named strLocations,initializing each element to the keyword Nothing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck