Deck 7: Arrays

ملء الشاشة (f)
exit full mode
سؤال
For an array that is dimensioned with a Length of 100,valid subscripts are 0 through 100.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When an array is sent to a method as an argument,if the method changes one or more of the elements,the changes are made to the actual data.
سؤال
To declare an array,the value(s)used inside the square bracket can be a constant literal,a variable,or an expression that produces an integral value.
سؤال
A parallel array is used to create string arrays because multiple characters are included within each element.
سؤال
Arrays can be used as fields or instance variables in classes;and,arrays of objects can be declared.
سؤال
If you use the params parameter type,params must appear both in the formal parameter list of the method heading and in the actual argument list.
سؤال
In C# the length of an array cannot be changed.After it is instantiated with a length,dynamic resizing is not an option.
سؤال
The type used in the foreach expression must match the array type.
سؤال
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
With the declaration above,price[5] generates a runtime error.
سؤال
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
With the declaration above,price[2] refers to 2.2.
سؤال
Because arrays are reference types,the ref keyword is required with the argument and parameter list.
سؤال
Arrays are reference variables.
سؤال
When a method uses the params modifier,it indicates that the number of arguments to the method may vary.
سؤال
Arrays can be sent to methods as arguments,and methods can have arrays as their return type.
سؤال
Properties are added to a class to enable client applications to access public members.
سؤال
Array identifiers are normally defined using a plural noun.
سؤال
The Clear( )method of the Array class sets all integer elements to zero.
سؤال
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
Looking above,the value of price.Length is 5.
سؤال
You can declare an array without dimensioning its size,but the size must be determined before you can access it.
سؤال
When you pass an array to a method,by default,a copy of each element in the array is made and passed to the method.
سؤال
With parallel arrays,the relationship is established through using the same subscript or index to refer to the elements in both arrays.
سؤال
All arrays are objects of the base type ____ class.

A) Object
B) Base
C) Super
D) Array
سؤال
The index is also referred to as the ____ of the array.

A) value
B) element
C) size
D) subscript
سؤال
int [ ] anArray = new int[24];
Array elements are normally stored in contiguous,side-by-side,memory locations with the first index in all arrays being referenced by index 0.
سؤال
There are several ways to do a compile-time initialization of arrays.All of the following are valid ways EXCEPT ____.

A) int [ ] anArray = {100, 100, 100};
B) int [ ] anArray = new int [ ] {100, 100, 100};
C) int [ ] anArray = new int [3 ] {100, 100, 100};
D) int [ ] anArray = new int [10 ] {100, 100, 100};
سؤال
int [ ] anArray = new int[24];
For the above declaration,25 cells are set aside for the array since the first element is referenced by index 0.
سؤال
All arrays are objects of the base type Array class.
سؤال
If an array named num is dimensioned to hold 10 values,how would you store 50 in the 5th physical location?

A) num[5] = 50;
B) num[4] = 50;
C) num = 50 [5] ;
D) num5 = 50;
سؤال
When you pass a single array element such as an integer,you are passing by reference.
سؤال
int [ ] anArray = new int[24];
You can instantiate arrays of user-defined array objects and send in arrays as arguments to methods,but you cannot return arrays from methods.
سؤال
You create an array in much the same way you instantiate an object of a user-defined class,by using the new keyword at the time of declaration.
سؤال
When you use the assignment operator with an array,individual elements are copied to another memory location.
سؤال
To declare and instantiate memory for 4 exam scores that range in value from 0 to 100,the following declaration could be made ____.

A) int examScore = new examScore[3];
B) int [ ] examScore = new examScore[4];
C) int [ ] examScore = new examScore[3];
D) int examScore[4] = new examScore[ ];
سؤال
Use .NET predefined methods and properties whenever possible as opposed to writing new
code.
سؤال
If an array named num is dimensioned to hold 10 values,what happens if you write num[100] = 50;?

A) A compilation error will be generated
B) A runtime error will be generated
C) 50 will be stored at the 100th indexed location
D) 50 will be stored at the last legal location
سؤال
int [ ] anArray = new int[24];
Array identifiers are normally defined using a plural noun.
سؤال
Given an array declared to hold 100 values,the smallest index that can be used with the array is ____.

A) based on what index is used when the first value is placed in the array
B) 1
C) 0
D) undetermined
سؤال
If you do not know how many entries will be stored with the array,you could dimension it ____.

A) small and then as more space is needed, adjust its size
B) large enough to hold the most likely number of entries
C) large enough to hold the maximum number of entries
D) as zero length and then add one to the length each time you add a value
سؤال
If you try to access the array using a negative index value,____.

A) a compilation error will be generate
B) a runtime error will be generated
C) the indexed location will be used. The computer will access memory to the left of the array
D) the smallest indexed location will be accessed
سؤال
Given an array declared to hold 100 values,the largest index that can be used with the array is:

A) based on what index is used when the first value is placed in the array
B) 99
C) 100
D) undetermined
سؤال
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
Which of the following would copy all of the elements from anotherArray to anArray?

A) Array.Copy(anotherArray, 0, anArray, 0, 10);
B) Array.Copy(anotherArray, anArray)
C) anArray = anotherArray
D) all of the above
سؤال
When two or more arrays have a relationship such that you are able to use the same subscript or index to refer to related elements in the arrays,you have ____ arrays.

A) parallel
B) two dimensional
C) dynamic
D) related
سؤال
What happens when you assign one array to another using the assignment operator?

A) An error message is generated.
B) Elements are copied to new memory locations.
C) Both arrays become value type data elements.
D) Both arrays reference the same memory locations.
سؤال
One of the special properties in the Array class is Length.It returns ____.

A) an int representing the number of values currently stored in the array
B) an int representing the size the array was dimensioned
C) how much storage is consumed by the entire array
D) the length of an individual element of the array
سؤال
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
anotherArray.Length returns ____.

A) 9
B) 10
C) 11
D) 20
سؤال
Which of the following could be a method heading for a member method that returns an array?

A) int [ ] void DoSomething( )
B) void int [ ] DoSomething( )
C) int [ ] DoSomething( )
D) void DoSomething[ ]
سؤال
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
How could all values of anotherArray be totaled?

A) foreach(int val in anotherArray)
Total += val;
B) for (int i = 0; i < anotherArray.Length; i++)
Total += anotherArray;
C) Array.Sum(anotherArray)
D) all of the above
سؤال
A limitation of the foreach loop structure when used with arrays is ____.

A) it offers read only access
B) it can only be used with integer arrays
C) a loop control variable must be defined on the outside of the loop
D) the control variable must be updated with each iteration
سؤال
Given an array declaration of int anArray[1000],which of the following would be a valid heading for a method that sends the array in as a parameter?

A) void DisplayContents(int anArray)
B) void DisplayContents(int anArray[])
C) void DisplayContents(int [ ] anArray)
D) void DisplayContents(anArray[1000])
سؤال
If an array is to be sent to a method,which of the following is a valid heading for a method?

A) void DisplayOutput(double [ ] anArray)
B) void DisplayOutput(double [10 ] anArray)
C) void DisplayOutput(double anArray)
D) void DisplayOutput(double anArray [10])
سؤال
Which of the following can be used to return an index of an item in an array?

A) LastIndexOf( )
B) Index( )
C) Find( )
D) SetValue( )
سؤال
____ creates a copy of the array and returns it as an object?

A) CopyObject( )
B) Clone( )
C) Copy( )
D) CreateArray( )
سؤال
foreach (int val in anotherArray) total += val;
Using the above declaration along with the foreach loop,what is stored in total after the program statements are executed?

A) 10
B) 2
C) 48
D) 45
سؤال
int [ ] score = {86,66,76,92,95,88}; for (int i = score.Length-1;i > -1;i--)
{
Total += score[i];
}
Using the declaration above for score,what is added to total during the first iteration?

A) 0
B) 88
C) 86, 66, 76, 92 and 95
D) unknown, because i is not initialized
سؤال
Given an array declaration of int anArray[1000],which of the following would be a valid call to a DisplayContents( )method to send the full array into the method as an argument?

A) DisplayContents(int anArray[1000])
B) DisplayContents(anArray[1000])
C) DisplayContents(anArray[ ] )
D) DisplayContents(anArray)
سؤال
for (int i = 0;i < anotherArray.Length;i++) total += i;
Using the above declaration along with the for loop,what is stored in total after the program statements are executed?

A) 10
B) 2
C) 48
D) 45
سؤال
Which loop structure can be used to change the contents of the array?

A) for
B) foreach
C) loop
D) if / else
سؤال
BinarySearch( )is ____.

A) a method in the Array class
B) an instance method
C) usable as long as you declare an array
D) must be used with integer arguments
سؤال
Which of the following is a valid example of calling a method and sending it an array argument?

A) DisplayArrayContents(int [ ] anArray);
B) DisplayArrayContents(anArray);
C) DisplayArrayContents(anArray[10]);
D) DisplayArrayContents(int [ 10] anArray);
سؤال
If you do not know the size of the array needed,you can create an array large enough to hold any number of entries and tell users to enter a predetermined sentinel value after they enter the last value.Using this approach:

A) requires that you increment a counter as values are entered so that you know how many elements are stored in your array
B) is preferred to defining a static sized array.
C) requires that you dimension the array to hold at least 100 entries.
D) requires the array be defined to hold string elements.
سؤال
The length or size of the array is specified using a(n)____________ value in the form of a constant literal,a variable,or an expression that produces an integer value.
سؤال
To create an array to hold the 5 numeric scores,you could write ____________.
سؤال
One of the special properties in the Array class is ____________.It returns an int representing the total number of elements in an array.
سؤال
All data values placed in an array must be of the same ____________.
سؤال
An entire array collection of data can be ordered alphabetically with a call to the Array class member method ____________.
سؤال
Elements in an array are sometimes referred to as ____________ variables.
سؤال
Array.Copy(waterDepth, 2, w, 0, 5);
The Copy( )method,shown above,is a(n)____________ method.
سؤال
All arrays,of any type,inherit characteristics from the ____________ class,which includes a number of predefined methods and properties.
سؤال
Use the ____________ keyword to instantiate an object of an array.
سؤال
Array identifiers are normally defined using a ____________.
سؤال
The ____________ loop structure can be used to iterate through an array.However,it can be used for read-only access to the elements.
سؤال
When you do a compile-time initialization of array elements,values are separated by ____________.
سؤال
The first element of an array is always referenced by index ____________.
سؤال
Arrays are ____________ variables.The array identifier memory location does not actually contain the values,but instead stores an address indicating the location of the first element in the array.
سؤال
To access an array element,you must specify which element is to be retrieved by placing an index inside ____________ following the array identifier
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 7: Arrays
1
For an array that is dimensioned with a Length of 100,valid subscripts are 0 through 100.
False
2
When an array is sent to a method as an argument,if the method changes one or more of the elements,the changes are made to the actual data.
True
3
To declare an array,the value(s)used inside the square bracket can be a constant literal,a variable,or an expression that produces an integral value.
True
4
A parallel array is used to create string arrays because multiple characters are included within each element.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
5
Arrays can be used as fields or instance variables in classes;and,arrays of objects can be declared.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
If you use the params parameter type,params must appear both in the formal parameter list of the method heading and in the actual argument list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
In C# the length of an array cannot be changed.After it is instantiated with a length,dynamic resizing is not an option.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
8
The type used in the foreach expression must match the array type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
9
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
With the declaration above,price[5] generates a runtime error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
10
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
With the declaration above,price[2] refers to 2.2.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
11
Because arrays are reference types,the ref keyword is required with the argument and parameter list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
12
Arrays are reference variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
13
When a method uses the params modifier,it indicates that the number of arguments to the method may vary.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
Arrays can be sent to methods as arguments,and methods can have arrays as their return type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
15
Properties are added to a class to enable client applications to access public members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
16
Array identifiers are normally defined using a plural noun.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
17
The Clear( )method of the Array class sets all integer elements to zero.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
18
double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4};
Looking above,the value of price.Length is 5.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
You can declare an array without dimensioning its size,but the size must be determined before you can access it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
When you pass an array to a method,by default,a copy of each element in the array is made and passed to the method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
21
With parallel arrays,the relationship is established through using the same subscript or index to refer to the elements in both arrays.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
22
All arrays are objects of the base type ____ class.

A) Object
B) Base
C) Super
D) Array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
The index is also referred to as the ____ of the array.

A) value
B) element
C) size
D) subscript
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
24
int [ ] anArray = new int[24];
Array elements are normally stored in contiguous,side-by-side,memory locations with the first index in all arrays being referenced by index 0.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
There are several ways to do a compile-time initialization of arrays.All of the following are valid ways EXCEPT ____.

A) int [ ] anArray = {100, 100, 100};
B) int [ ] anArray = new int [ ] {100, 100, 100};
C) int [ ] anArray = new int [3 ] {100, 100, 100};
D) int [ ] anArray = new int [10 ] {100, 100, 100};
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
int [ ] anArray = new int[24];
For the above declaration,25 cells are set aside for the array since the first element is referenced by index 0.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
27
All arrays are objects of the base type Array class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
If an array named num is dimensioned to hold 10 values,how would you store 50 in the 5th physical location?

A) num[5] = 50;
B) num[4] = 50;
C) num = 50 [5] ;
D) num5 = 50;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
29
When you pass a single array element such as an integer,you are passing by reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
int [ ] anArray = new int[24];
You can instantiate arrays of user-defined array objects and send in arrays as arguments to methods,but you cannot return arrays from methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
31
You create an array in much the same way you instantiate an object of a user-defined class,by using the new keyword at the time of declaration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
32
When you use the assignment operator with an array,individual elements are copied to another memory location.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
33
To declare and instantiate memory for 4 exam scores that range in value from 0 to 100,the following declaration could be made ____.

A) int examScore = new examScore[3];
B) int [ ] examScore = new examScore[4];
C) int [ ] examScore = new examScore[3];
D) int examScore[4] = new examScore[ ];
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
34
Use .NET predefined methods and properties whenever possible as opposed to writing new
code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
If an array named num is dimensioned to hold 10 values,what happens if you write num[100] = 50;?

A) A compilation error will be generated
B) A runtime error will be generated
C) 50 will be stored at the 100th indexed location
D) 50 will be stored at the last legal location
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
int [ ] anArray = new int[24];
Array identifiers are normally defined using a plural noun.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
Given an array declared to hold 100 values,the smallest index that can be used with the array is ____.

A) based on what index is used when the first value is placed in the array
B) 1
C) 0
D) undetermined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
If you do not know how many entries will be stored with the array,you could dimension it ____.

A) small and then as more space is needed, adjust its size
B) large enough to hold the most likely number of entries
C) large enough to hold the maximum number of entries
D) as zero length and then add one to the length each time you add a value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
39
If you try to access the array using a negative index value,____.

A) a compilation error will be generate
B) a runtime error will be generated
C) the indexed location will be used. The computer will access memory to the left of the array
D) the smallest indexed location will be accessed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
Given an array declared to hold 100 values,the largest index that can be used with the array is:

A) based on what index is used when the first value is placed in the array
B) 99
C) 100
D) undetermined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
41
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
Which of the following would copy all of the elements from anotherArray to anArray?

A) Array.Copy(anotherArray, 0, anArray, 0, 10);
B) Array.Copy(anotherArray, anArray)
C) anArray = anotherArray
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
When two or more arrays have a relationship such that you are able to use the same subscript or index to refer to related elements in the arrays,you have ____ arrays.

A) parallel
B) two dimensional
C) dynamic
D) related
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
What happens when you assign one array to another using the assignment operator?

A) An error message is generated.
B) Elements are copied to new memory locations.
C) Both arrays become value type data elements.
D) Both arrays reference the same memory locations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
44
One of the special properties in the Array class is Length.It returns ____.

A) an int representing the number of values currently stored in the array
B) an int representing the size the array was dimensioned
C) how much storage is consumed by the entire array
D) the length of an individual element of the array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
anotherArray.Length returns ____.

A) 9
B) 10
C) 11
D) 20
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following could be a method heading for a member method that returns an array?

A) int [ ] void DoSomething( )
B) void int [ ] DoSomething( )
C) int [ ] DoSomething( )
D) void DoSomething[ ]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
int [ ] anArray = new int [10];
int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1};
How could all values of anotherArray be totaled?

A) foreach(int val in anotherArray)
Total += val;
B) for (int i = 0; i < anotherArray.Length; i++)
Total += anotherArray;
C) Array.Sum(anotherArray)
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
48
A limitation of the foreach loop structure when used with arrays is ____.

A) it offers read only access
B) it can only be used with integer arrays
C) a loop control variable must be defined on the outside of the loop
D) the control variable must be updated with each iteration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
49
Given an array declaration of int anArray[1000],which of the following would be a valid heading for a method that sends the array in as a parameter?

A) void DisplayContents(int anArray)
B) void DisplayContents(int anArray[])
C) void DisplayContents(int [ ] anArray)
D) void DisplayContents(anArray[1000])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
If an array is to be sent to a method,which of the following is a valid heading for a method?

A) void DisplayOutput(double [ ] anArray)
B) void DisplayOutput(double [10 ] anArray)
C) void DisplayOutput(double anArray)
D) void DisplayOutput(double anArray [10])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
51
Which of the following can be used to return an index of an item in an array?

A) LastIndexOf( )
B) Index( )
C) Find( )
D) SetValue( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
52
____ creates a copy of the array and returns it as an object?

A) CopyObject( )
B) Clone( )
C) Copy( )
D) CreateArray( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
foreach (int val in anotherArray) total += val;
Using the above declaration along with the foreach loop,what is stored in total after the program statements are executed?

A) 10
B) 2
C) 48
D) 45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
54
int [ ] score = {86,66,76,92,95,88}; for (int i = score.Length-1;i > -1;i--)
{
Total += score[i];
}
Using the declaration above for score,what is added to total during the first iteration?

A) 0
B) 88
C) 86, 66, 76, 92 and 95
D) unknown, because i is not initialized
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
Given an array declaration of int anArray[1000],which of the following would be a valid call to a DisplayContents( )method to send the full array into the method as an argument?

A) DisplayContents(int anArray[1000])
B) DisplayContents(anArray[1000])
C) DisplayContents(anArray[ ] )
D) DisplayContents(anArray)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
56
for (int i = 0;i < anotherArray.Length;i++) total += i;
Using the above declaration along with the for loop,what is stored in total after the program statements are executed?

A) 10
B) 2
C) 48
D) 45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
57
Which loop structure can be used to change the contents of the array?

A) for
B) foreach
C) loop
D) if / else
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
58
BinarySearch( )is ____.

A) a method in the Array class
B) an instance method
C) usable as long as you declare an array
D) must be used with integer arguments
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
Which of the following is a valid example of calling a method and sending it an array argument?

A) DisplayArrayContents(int [ ] anArray);
B) DisplayArrayContents(anArray);
C) DisplayArrayContents(anArray[10]);
D) DisplayArrayContents(int [ 10] anArray);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
60
If you do not know the size of the array needed,you can create an array large enough to hold any number of entries and tell users to enter a predetermined sentinel value after they enter the last value.Using this approach:

A) requires that you increment a counter as values are entered so that you know how many elements are stored in your array
B) is preferred to defining a static sized array.
C) requires that you dimension the array to hold at least 100 entries.
D) requires the array be defined to hold string elements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
61
The length or size of the array is specified using a(n)____________ value in the form of a constant literal,a variable,or an expression that produces an integer value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
To create an array to hold the 5 numeric scores,you could write ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
63
One of the special properties in the Array class is ____________.It returns an int representing the total number of elements in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
64
All data values placed in an array must be of the same ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
An entire array collection of data can be ordered alphabetically with a call to the Array class member method ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
66
Elements in an array are sometimes referred to as ____________ variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
67
Array.Copy(waterDepth, 2, w, 0, 5);
The Copy( )method,shown above,is a(n)____________ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
68
All arrays,of any type,inherit characteristics from the ____________ class,which includes a number of predefined methods and properties.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
Use the ____________ keyword to instantiate an object of an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
70
Array identifiers are normally defined using a ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
The ____________ loop structure can be used to iterate through an array.However,it can be used for read-only access to the elements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
72
When you do a compile-time initialization of array elements,values are separated by ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
The first element of an array is always referenced by index ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
74
Arrays are ____________ variables.The array identifier memory location does not actually contain the values,but instead stores an address indicating the location of the first element in the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
75
To access an array element,you must specify which element is to be retrieved by placing an index inside ____________ following the array identifier
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.