Deck 7: Arrays and Lists

ملء الشاشة (f)
exit full mode
سؤال
Which one of the following declaration statements is not a value type?

A) decimal grossPay = 0.0m;
B) int playerScore = 0;
C) bool qualify = false;
D) Random rand = new Random();
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which one of the following statements assigns the value 40 to the first element in an array of integers named values?

A) values[-1] = 40;
B) values[0] = 40;
C) values[null] = 40;
D) values[1] = 40;
سؤال
A(n) ____________ is a special value that links a variable to an object.

A) linker
B) reference
C) operator
D) delimiter
سؤال
A(n) ____________ is an object that can hold a group of values that must all be the same data type.

A) matrix
B) Collection
C) array
D) container
سؤال
The ____________ creates an object in memory and returns a reference to that object.

A) .NET Framework
B) new operator
C) = operator
D) % operator
سؤال
An array's____________ indicates the number of values that the array should be able to hold.

A) reference variable
B) size declarator
C) element
D) subscript
سؤال
A variable that is used to reference an object is commonly called a(n) ____________.

A) reference variable
B) object variable
C) class variable
D) Boolean variable
سؤال
When a(n) ____________ variable is declared, the compiler sets aside, or allocates, a chunk of memory big enough to hold the variable's data.

A) reference type
B) uninitialized
C) value type
D) dynamic type
سؤال
Of the following statements, which one correctly initializes an int array named quarters with the values 1, 2, 3, and 4?

A) const int SIZE = 4; int[] quarters = new int[SIZE] { 1, 2, 3, 4 };
B) int[] quarters = new int[] { 1, 2, 3, 4 };
C) int[] quarters = { 1, 2, 3, 4 };
D) All of these statements are correct.
سؤال
Look at the following code sample: const int SIZE = 10;
Int[] values = new int[SIZE];
For (int index = 0; index < SIZE; index++)
{
Values[index] = index + 1;
}
When the loop is finished stepping through the values array, what value will be stored in values[0]?

A) 10
B) 11
C) 0
D) 1
سؤال
When you create a numeric array in C#, what default value is assigned to its elements?

A) null
B) 0
C) 255
D) −1
سؤال
The storage locations in an array are known as ____________.

A) values
B) sectors
C) compartments
D) elements
سؤال
Which one of the following assignment statements associates an int array, that can hold 12 integers, with a reference variable named scores?

A) scores = new int[12];
B) int[12] = new scores;
C) int scores[12];
D) new int scores[12]
سؤال
When you create an array, you can optionally initialize it with a collection of values called a(n) ____________.

A) initialization list
B) default group
C) element assembly
D) starting run
سؤال
It is preferred practice to use a(n) ____________ as an array's size declarator.

A) variable
B) literal value
C) named constant
D) object
سؤال
Which one of the following statements correctly declares a reference variable named values that can be used to reference an array of int?

A) int values[];
B) values[int];
C) int[] values;
D) int [values];
سؤال
What special value are the elements of an array of reference type objects equal to by default?

A) 0
B) void
C) −1
D) null
سؤال
Each element in an array is identified by a unique number known as a(n) ____________.

A) subscript
B) identifier
C) delimiter
D) vector
سؤال
When working with an array, it is important that you do not use a(n)____________.

A) invalid subscript
B) null value
C) assignment statement
D) initialization list
سؤال
Which one of the following statements is not a valid array declaration?

A) double[] parsecs = new double[10];
B) decimal[] sales = new decimal[24.5m];
C) string[] cities = new decimal[50];
D) int[] quarters = new int[4];
سؤال
C# provides a special loop known as the ____________, that automatically iterates once for each element in the array.

A) do-while loop
B) foreach loop
C) for loop
D) while loop
سؤال
A(n) ____________ occurs when a loop iterates one time too many or one time too few.

A) off-by-one error
B) buffer overrun
C) system crash
D) logic error
سؤال
____________ is a process that runs automatically in the background from time to time, removing all unreferenced objects from memory.

A) System cleanup
B) Garbage collection
C) Nullification
D) Non-maskable Interrupt
سؤال
The ____________ algorithm is much more efficient than a sequential search when the data set is very large.

A) random search
B) quick sort
C) binary search
D) combinatorial search
سؤال
When you process a(n) ____________, you must process only elements containing valid items.

A) partially filled array
B) reference copy
C) sequential search
D) Boolean expression
سؤال
Because arrays are always passed ____________, a method that receives an array as an argument has access to the actual array.

A) by value
B) globally
C) in memory
D) by reference
سؤال
Various techniques known as ____________ have been developed to locate a specific item in a larger collection of data, such as an array.

A) search engine schematics
B) search algorithms
C) database logic
D) search protocols
سؤال
When only a reference to an object is copied rather than the object's contents, the copy is called a(n) ____________.

A) shallow copy
B) memory copy
C) value copy
D) reference copy
سؤال
When calling a method and passing an array variable as an argument, the variable contains a ____________ to the array.

A) variable
B) value
C) reference
D) parameter
سؤال
With what value should the accumulator variable be initialized to calculate the total of all values in a numeric array?

A) null
B) false
C) 0
D) −1
سؤال
To compare the contents of two arrays, you must compare each of the ____________ in the two arrays.

A) memory locations
B) reference variables
C) elements
D) size
سؤال
To declare a two-dimensional array, two ____________ are required: The first one is for the number of rows, and the second one is for the number of columns.

A) reference variables
B) Boolean variables
C) named constants
D) size declarators
سؤال
The foreach loop is designed to work with a temporary, read-only variable known as the ____________.

A) loop variable
B) counter variable
C) iteration variable
D) foreach variable
سؤال
____________ arrays, also known as 2D arrays, can hold two sets of data.

A) Double-data
B) Two-dimensional
C) Row-column
D) Duel-derivative
سؤال
To successfully ____________ the contents of two variables, we need a third variable that can serve as a temporary storage location.

A) copy
B) exchange
C) reference
D) remove
سؤال
The ____________ works like this: The smallest value in the array is located and moved to element 0. The next smallest value is located and moved to element 1. This process continues until all the elements have been placed in their proper order.

A) bubble sort
B) binary search
C) Boolean swap
D) selection sort
سؤال
Look at the following code sample: int[] numbers = { 1, 2, 3, 4, 5 };
Int highest = numbers[0];
For (int index = 1; index < numbers.Length; index++)
{
If (numbers[index] > highest)
{
Highest = numbers[index];
}
}
What value will the highest variable contain when the loop finishes?

A) 1
B) 3
C) 5
D) 15
سؤال
____________ arrays can only hold one set of data.

A) One-dimensional
B) Two-dimensional
C) Data bound
D) Classical
سؤال
In C#, all arrays have a(n) ____________ that equals the number of elements in the array.

A) Element property
B) getSize method
C) Length property
D) GetBounds method
سؤال
The ____________ uses a loop to step through the elements in an an array one by one, from the first to the last.

A) sequential search algorithm
B) optimized search algorithm
C) binary search algorithm
D) basic array traversal algorithm
سؤال
A List object has a(n) ____________ that holds the number of items stored in the List.

A) Count property
B) Total property
C) Length property
D) Size property
سؤال
If you want to take out all items from a List object, call the ____________ method.

A) Clear
B) Reset
C) ClearAll
D) ReDim
سؤال
You can use the ____________ to take out an item at a specific index in a List.

A) Delete method
B) RemoveAt method
C) DeleteAt method
D) EraseAt method
سؤال
You can call the ____________ method to insert an item at a specific index position in a List object.

A) Put
B) Add
C) Insert
D) Place
سؤال
Memory allocated for a reference type variable is the actual location that will hold any value assigned to the variable.
سؤال
Look at the following code sample: int[,] values = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 } };
What is the value stored in values[1, 2]?

A) 2
B) 3
C) 6
D) 7
سؤال
Reference variables can only reference objects.
سؤال
Which one of the following statements correctly creates a List object named friendsList that holds strings?

A) string friendsList = new List;
B) friendsList(string);
C) List friendsList = new List;
D) List friendsList = new List();
سؤال
A(n) ____________ is similar to an array, but it can expand at runtime.

A) List object
B) sequential object
C) Random object
D) jagged array
سؤال
If you know the value of the item you want to take out from a List object, but you do not know the item's index, you can use the ____________.

A) - (minus) operator
B) Erase method
C) Remove method
D) Delete method
سؤال
A(n) ____________ is similar to a two-dimensional array, but the rows can have a different number of columns.

A) offset array
B) skewed array
C) jagged array
D) differential array
سؤال
Data types in C# − and the underlying .NET Framework − fall into two categories: value types and reference types.
سؤال
List objects, like arrays, are always passed to methods ____________.

A) by value
B) in memory
C) by reference
D) globally
سؤال
Look at the following code sample: const int ROWS = 2;
Const int COLS = 2;
Int[,] grid = new int[ROWS, COLS];
What is the total number of elements in the grid array?

A) 2
B) 4
C) 8
D) 16
سؤال
You can store a variety of data types in an array.
سؤال
Creating a reference type object typically requires the following two steps, which can optionally be coded in a single program statement:
1. Declare a reference variable.
2. Create an object and associate it with the reference variable.
سؤال
Look at the following code sample: const int ROWS = 8;
Const int COLS = 2;
Int[,] table = new int[ROWS, COLS];
Which one of the following statements stores the value 25 in the element located at the first row and second column of the table array?

A) table[1, 2] = 25;
B) table[0, 1] = 25;
C) table[2, 1] = 25;
D) table[1, 0] = 25;
سؤال
Because variables hold only single values, they can be cumbersome in programs that process lists of data.
سؤال
Traditional two-dimensional arrays, where each row has the same number of columns, are sometime referred to as ____________.

A) square arrays
B) rectangular arrays
C) box arrays
D) 2D arrays
سؤال
To add items to an existing List object, use the ____________.

A) += operator
B) & operator
C) Insert property
D) Add method
سؤال
When working with an array, you cannot use a subscript that is less than 0 or greater than the array size minus 1.
سؤال
Because the foreach loop automatically knows the number of elements in an array, you do not have to use a counter variable to control its iterations, as you would with a regular for loop.
سؤال
You can create an array to hold any single type of value.
سؤال
The default value of a string array's elements is null.
سؤال
Arrays are reference type objects.
سؤال
The sequential search algorithm is the simplest of all array searching algorithms.
سؤال
You access the individual elements in an array using their subscripts.
سؤال
An array's size declarator must be a nonnegative integer value.
سؤال
Because subscript numbering starts at 0, the subscript of the last element in an array is 1 less than the total number of elements in the array.
سؤال
When you use either the ref or out keywords before an array parameter, the receiving method does not automatically make a local copy of the array.
سؤال
The first element in an array is assigned subscript 1, the second element is assigned subscript 2, and so on.
سؤال
When reading the contents of a file into an array, your loop should always iterate until the array is full.
سؤال
To write the contents of an array to a file, open the file and use a loop to step through each array element, writing it to the file. Then close the file.
سؤال
The ref keyword creates an object in memory and returns a reference to the object it creates.
سؤال
Because array subscripts start at 1 rather than 0, you are not as likely to perform an off-by-one error.
سؤال
Arrays are always passed by value when passed as method arguments.
سؤال
If you provide an initialization list when declaring an array, you can leave out the size declarator, but you cannot leave out the new operator and its subsequent expression.
سؤال
You cannot reassign an array reference variable to a different array.
سؤال
When processing the contents of an array, the foreach loop does not provide a variable that can be used as an array subscript.
سؤال
An array's Length property is read-only, so you cannot change its value by trying to assign a new value to Length.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/99
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 7: Arrays and Lists
1
Which one of the following declaration statements is not a value type?

A) decimal grossPay = 0.0m;
B) int playerScore = 0;
C) bool qualify = false;
D) Random rand = new Random();
D
2
Which one of the following statements assigns the value 40 to the first element in an array of integers named values?

A) values[-1] = 40;
B) values[0] = 40;
C) values[null] = 40;
D) values[1] = 40;
B
3
A(n) ____________ is a special value that links a variable to an object.

A) linker
B) reference
C) operator
D) delimiter
B
4
A(n) ____________ is an object that can hold a group of values that must all be the same data type.

A) matrix
B) Collection
C) array
D) container
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
5
The ____________ creates an object in memory and returns a reference to that object.

A) .NET Framework
B) new operator
C) = operator
D) % operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
6
An array's____________ indicates the number of values that the array should be able to hold.

A) reference variable
B) size declarator
C) element
D) subscript
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
7
A variable that is used to reference an object is commonly called a(n) ____________.

A) reference variable
B) object variable
C) class variable
D) Boolean variable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
8
When a(n) ____________ variable is declared, the compiler sets aside, or allocates, a chunk of memory big enough to hold the variable's data.

A) reference type
B) uninitialized
C) value type
D) dynamic type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
9
Of the following statements, which one correctly initializes an int array named quarters with the values 1, 2, 3, and 4?

A) const int SIZE = 4; int[] quarters = new int[SIZE] { 1, 2, 3, 4 };
B) int[] quarters = new int[] { 1, 2, 3, 4 };
C) int[] quarters = { 1, 2, 3, 4 };
D) All of these statements are correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
10
Look at the following code sample: const int SIZE = 10;
Int[] values = new int[SIZE];
For (int index = 0; index < SIZE; index++)
{
Values[index] = index + 1;
}
When the loop is finished stepping through the values array, what value will be stored in values[0]?

A) 10
B) 11
C) 0
D) 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
11
When you create a numeric array in C#, what default value is assigned to its elements?

A) null
B) 0
C) 255
D) −1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
12
The storage locations in an array are known as ____________.

A) values
B) sectors
C) compartments
D) elements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which one of the following assignment statements associates an int array, that can hold 12 integers, with a reference variable named scores?

A) scores = new int[12];
B) int[12] = new scores;
C) int scores[12];
D) new int scores[12]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
14
When you create an array, you can optionally initialize it with a collection of values called a(n) ____________.

A) initialization list
B) default group
C) element assembly
D) starting run
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
15
It is preferred practice to use a(n) ____________ as an array's size declarator.

A) variable
B) literal value
C) named constant
D) object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which one of the following statements correctly declares a reference variable named values that can be used to reference an array of int?

A) int values[];
B) values[int];
C) int[] values;
D) int [values];
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
17
What special value are the elements of an array of reference type objects equal to by default?

A) 0
B) void
C) −1
D) null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
18
Each element in an array is identified by a unique number known as a(n) ____________.

A) subscript
B) identifier
C) delimiter
D) vector
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
19
When working with an array, it is important that you do not use a(n)____________.

A) invalid subscript
B) null value
C) assignment statement
D) initialization list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which one of the following statements is not a valid array declaration?

A) double[] parsecs = new double[10];
B) decimal[] sales = new decimal[24.5m];
C) string[] cities = new decimal[50];
D) int[] quarters = new int[4];
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
21
C# provides a special loop known as the ____________, that automatically iterates once for each element in the array.

A) do-while loop
B) foreach loop
C) for loop
D) while loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
22
A(n) ____________ occurs when a loop iterates one time too many or one time too few.

A) off-by-one error
B) buffer overrun
C) system crash
D) logic error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
23
____________ is a process that runs automatically in the background from time to time, removing all unreferenced objects from memory.

A) System cleanup
B) Garbage collection
C) Nullification
D) Non-maskable Interrupt
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ____________ algorithm is much more efficient than a sequential search when the data set is very large.

A) random search
B) quick sort
C) binary search
D) combinatorial search
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
25
When you process a(n) ____________, you must process only elements containing valid items.

A) partially filled array
B) reference copy
C) sequential search
D) Boolean expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
26
Because arrays are always passed ____________, a method that receives an array as an argument has access to the actual array.

A) by value
B) globally
C) in memory
D) by reference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
27
Various techniques known as ____________ have been developed to locate a specific item in a larger collection of data, such as an array.

A) search engine schematics
B) search algorithms
C) database logic
D) search protocols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
28
When only a reference to an object is copied rather than the object's contents, the copy is called a(n) ____________.

A) shallow copy
B) memory copy
C) value copy
D) reference copy
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
29
When calling a method and passing an array variable as an argument, the variable contains a ____________ to the array.

A) variable
B) value
C) reference
D) parameter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
30
With what value should the accumulator variable be initialized to calculate the total of all values in a numeric array?

A) null
B) false
C) 0
D) −1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
31
To compare the contents of two arrays, you must compare each of the ____________ in the two arrays.

A) memory locations
B) reference variables
C) elements
D) size
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
32
To declare a two-dimensional array, two ____________ are required: The first one is for the number of rows, and the second one is for the number of columns.

A) reference variables
B) Boolean variables
C) named constants
D) size declarators
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
33
The foreach loop is designed to work with a temporary, read-only variable known as the ____________.

A) loop variable
B) counter variable
C) iteration variable
D) foreach variable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
34
____________ arrays, also known as 2D arrays, can hold two sets of data.

A) Double-data
B) Two-dimensional
C) Row-column
D) Duel-derivative
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
35
To successfully ____________ the contents of two variables, we need a third variable that can serve as a temporary storage location.

A) copy
B) exchange
C) reference
D) remove
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
36
The ____________ works like this: The smallest value in the array is located and moved to element 0. The next smallest value is located and moved to element 1. This process continues until all the elements have been placed in their proper order.

A) bubble sort
B) binary search
C) Boolean swap
D) selection sort
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
37
Look at the following code sample: int[] numbers = { 1, 2, 3, 4, 5 };
Int highest = numbers[0];
For (int index = 1; index < numbers.Length; index++)
{
If (numbers[index] > highest)
{
Highest = numbers[index];
}
}
What value will the highest variable contain when the loop finishes?

A) 1
B) 3
C) 5
D) 15
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
38
____________ arrays can only hold one set of data.

A) One-dimensional
B) Two-dimensional
C) Data bound
D) Classical
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
39
In C#, all arrays have a(n) ____________ that equals the number of elements in the array.

A) Element property
B) getSize method
C) Length property
D) GetBounds method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
40
The ____________ uses a loop to step through the elements in an an array one by one, from the first to the last.

A) sequential search algorithm
B) optimized search algorithm
C) binary search algorithm
D) basic array traversal algorithm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
41
A List object has a(n) ____________ that holds the number of items stored in the List.

A) Count property
B) Total property
C) Length property
D) Size property
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
42
If you want to take out all items from a List object, call the ____________ method.

A) Clear
B) Reset
C) ClearAll
D) ReDim
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
43
You can use the ____________ to take out an item at a specific index in a List.

A) Delete method
B) RemoveAt method
C) DeleteAt method
D) EraseAt method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
44
You can call the ____________ method to insert an item at a specific index position in a List object.

A) Put
B) Add
C) Insert
D) Place
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
45
Memory allocated for a reference type variable is the actual location that will hold any value assigned to the variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
46
Look at the following code sample: int[,] values = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 } };
What is the value stored in values[1, 2]?

A) 2
B) 3
C) 6
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
47
Reference variables can only reference objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which one of the following statements correctly creates a List object named friendsList that holds strings?

A) string friendsList = new List;
B) friendsList(string);
C) List friendsList = new List;
D) List friendsList = new List();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
49
A(n) ____________ is similar to an array, but it can expand at runtime.

A) List object
B) sequential object
C) Random object
D) jagged array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
50
If you know the value of the item you want to take out from a List object, but you do not know the item's index, you can use the ____________.

A) - (minus) operator
B) Erase method
C) Remove method
D) Delete method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
51
A(n) ____________ is similar to a two-dimensional array, but the rows can have a different number of columns.

A) offset array
B) skewed array
C) jagged array
D) differential array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
52
Data types in C# − and the underlying .NET Framework − fall into two categories: value types and reference types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
53
List objects, like arrays, are always passed to methods ____________.

A) by value
B) in memory
C) by reference
D) globally
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
54
Look at the following code sample: const int ROWS = 2;
Const int COLS = 2;
Int[,] grid = new int[ROWS, COLS];
What is the total number of elements in the grid array?

A) 2
B) 4
C) 8
D) 16
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
55
You can store a variety of data types in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
56
Creating a reference type object typically requires the following two steps, which can optionally be coded in a single program statement:
1. Declare a reference variable.
2. Create an object and associate it with the reference variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
57
Look at the following code sample: const int ROWS = 8;
Const int COLS = 2;
Int[,] table = new int[ROWS, COLS];
Which one of the following statements stores the value 25 in the element located at the first row and second column of the table array?

A) table[1, 2] = 25;
B) table[0, 1] = 25;
C) table[2, 1] = 25;
D) table[1, 0] = 25;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
58
Because variables hold only single values, they can be cumbersome in programs that process lists of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
59
Traditional two-dimensional arrays, where each row has the same number of columns, are sometime referred to as ____________.

A) square arrays
B) rectangular arrays
C) box arrays
D) 2D arrays
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
60
To add items to an existing List object, use the ____________.

A) += operator
B) & operator
C) Insert property
D) Add method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
61
When working with an array, you cannot use a subscript that is less than 0 or greater than the array size minus 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
62
Because the foreach loop automatically knows the number of elements in an array, you do not have to use a counter variable to control its iterations, as you would with a regular for loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
63
You can create an array to hold any single type of value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
64
The default value of a string array's elements is null.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
65
Arrays are reference type objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
66
The sequential search algorithm is the simplest of all array searching algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
67
You access the individual elements in an array using their subscripts.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
68
An array's size declarator must be a nonnegative integer value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
69
Because subscript numbering starts at 0, the subscript of the last element in an array is 1 less than the total number of elements in the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
70
When you use either the ref or out keywords before an array parameter, the receiving method does not automatically make a local copy of the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
71
The first element in an array is assigned subscript 1, the second element is assigned subscript 2, and so on.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
72
When reading the contents of a file into an array, your loop should always iterate until the array is full.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
73
To write the contents of an array to a file, open the file and use a loop to step through each array element, writing it to the file. Then close the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
74
The ref keyword creates an object in memory and returns a reference to the object it creates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
75
Because array subscripts start at 1 rather than 0, you are not as likely to perform an off-by-one error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
76
Arrays are always passed by value when passed as method arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
77
If you provide an initialization list when declaring an array, you can leave out the size declarator, but you cannot leave out the new operator and its subsequent expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
78
You cannot reassign an array reference variable to a different array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
79
When processing the contents of an array, the foreach loop does not provide a variable that can be used as an array subscript.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
80
An array's Length property is read-only, so you cannot change its value by trying to assign a new value to Length.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.