Deck 7: Arrays and Lists

ملء الشاشة (f)
exit full mode
سؤال
When you create a numeric array in C#, what value are its elements set to by default?

A) null
B) 0
C) 255
D) -1
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When you create an array, you can optionally initialize it with a group of values called a(n) ____________.

A) initialization list
B) default group
C) element assembly
D) starting run
سؤال
When you are working with a(n) ____________ variable, the compiler sets aside, or allocates, a chunk of memory that is big enough for that variable.

A) reference type
B) uninitialized
C) value type
D) dynamic type
سؤال
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]
سؤال
What special value are the elements of an array of reference type objects set to by default?

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

A) values
B) sectors
C) compartments
D) elements
سؤال
The ____________ creates an object in memory and returns a reference to that object.

A) .NET Framework
B) new operator
C) = operator
D) % operator
سؤال
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];
سؤال
It is preferred practice to use a(n) ____________ as an array's size declarator.

A) variable
B) literal value
C) named constant
D) object
سؤال
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.
سؤال
A(n) ____________ is an object that can hold a group of values that are all the same data type.

A) matrix
B) list
C) array
D) container
سؤال
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
سؤال
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();
سؤال
A(n) ____________ is a special value that links a variable to an object.

A) linker
B) reference
C) operator
D) delimiter
سؤال
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
سؤال
Each element in an array is assigned a unique number known as a(n) ____________.

A) subscript
B) identifier
C) delimiter
D) vector
سؤال
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
سؤال
Which one of the following statements declares a reference variable named values that can be used to reference an int array?

A) int values[];
B) values[int];
C) int[] values;
D) int [values];
سؤال
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 assigns the value 40 to the first element in an int array named values?

A) values[-1] = 40;
B) values[0] = 40;
C) values[null] = 40;
D) values[1] = 40;
سؤال
____________ is a process that periodically runs, removing all unreferenced objects from memory.

A) System cleanup
B) Garbage collection
C) Nullification
D) Non-maskable Interrupt
سؤال
The ____________ is a clever algorithm that is much more efficient that the sequential search.

A) random search
B) quick sort
C) binary search
D) combinatorial search
سؤال
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
سؤال
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) referential protocols
سؤال
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
سؤال
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
سؤال
To successfully ____________ the contents of two variables, we need a third variable that can serve as a temporary storage location.

A) copy
B) swap
C) reference
D) remove
سؤال
To compare the contents of two arrays, you must compare the ____________ of the two arrays.

A) memory locations
B) reference variables
C) elements
D) size
سؤال
In C#, all arrays have a(n) ____________ that is set to the number of elements in the array.

A) Element property
B) getSize method
C) Length property
D) GetBounds method
سؤال
When you call a method and pass an array as an argument, you simply pass the____________ that references the array.

A) data
B) method
C) variable
D) class
سؤال
When you process a(n) ____________, you must process only the elements that contain valid items.

A) partially filled array
B) reference copy
C) sequential search
D) Boolean expression
سؤال
____________ arrays, which are also called 2D arrays, can hold multiple sets of data.

A) Double-data
B) Two-dimensional
C) Row-column
D) Duel-derivative
سؤال
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
سؤال
When only a reference of an object is copied and not the contents of the object itself, it is called a(n) ____________.

A) shadow copy
B) memory copy
C) error copy
D) reference copy
سؤال
The ____________ uses a loop to sequentially step through an array, starting with the first element.

A) sequential search algorithm
B) top-down algorithm
C) simple search algorithm
D) basic array traversal algorithm
سؤال
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
سؤال
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
سؤال
With what value should the accumulator variable be initialized to calculate the total of the values in a numeric array?

A) null
B) false
C) 0
D) -1
سؤال
____________ arrays can only hold one set of data.

A) One-dimensional
B) Two-dimensional
C) Data bound
D) Classical
سؤال
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
سؤال
All the data types in C# − and the underlying .NET Framework − fall into two categories: value types and reference types.
سؤال
The memory that is allocated for a reference type variable is the actual location that will hold any value that is assigned to that variable.
سؤال
Reference variables can be used only to reference objects.
سؤال
If you want to remove all the items from a List, you can call the ____________ method.

A) Clear
B) Reset
C) ClearAll
D) NewList
سؤال
A(n) ____________ is similar to an array but offers many advantages over an array.

A) List object
B) Collection
C) Random object
D) jagged array
سؤال
A List object has a(n) ____________ that holds the number of items stored in the List.

A) Count property
B) Total property
C) reference variable
D) extra memory location
سؤال
To add items to an existing List object, you use the ____________.

A) += operator
B) & operator
C) Insert property
D) Add method
سؤال
You can use the ____________ to remove an item at a specific index in a List.

A) Delete method
B) RemoveAt method
C) null keyword
D) Erase property
سؤال
You can store a mixture of data types in an array.
سؤال
You can use the ____________ to insert an item at a specific index in a List.

A) + operator
B) Add method
C) Insert method
D) Place property
سؤال
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
سؤال
Because variables hold only a single value, they can be cumbersome in programs that process lists of data.
سؤال
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;
سؤال
Which one of the following statements creates a List object, named friendsList, that can be used to hold strings?

A) string friendsList = new List;
B) friendsList(string);
C) List friendsList = new List;
D) List friendsList = new List();
سؤال
List objects, like arrays, are always passed to a method ____________.

A) by value
B) in memory
C) by reference
D) globally
سؤال
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
سؤال
Look at the following code sample: int[,] values = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 } };
What is the value stored in values[2, 2]?

A) 2
B) 3
C) 6
D) 7
سؤال
If you know the value of the item that you want to remove from a List, but you do not know the item's index, you can use the ____________.

A) - operator
B) Erase method
C) Remove method
D) -= operator
سؤال
Creating a reference type object typically requires the following two steps:
1. You declare a reference variable.
2. You create the object and associate it with the reference variable.
سؤال
When processing the contents of an array, there are some circumstances in which the foreach loop is not adequate, and the for loop should be used instead.
سؤال
When you use either the ref or out keywords with an array parameter, the receiving method not only has access to the array, but it also has access to the reference variable that was used to pass the array.
سؤال
When working with an array, you cannot use a subscript that is less than 0 or greater than the size of the array minus 1.
سؤال
The first element in an array is assigned the subscript 1, the second element is assigned the subscript 2, and so forth.
سؤال
Writing the contents of an array to a file is a straightforward procedure: Open the file and use a loop to step through each element of the array, writing its contents to the file.
سؤال
Arrays are reference type objects.
سؤال
Arrays are always passed by 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.
سؤال
The sequential search algorithm is the simplest of all search algorithms.
سؤال
Because array subscripts start at 1 rather than 0, you are not as likely to perform an off-by-one error.
سؤال
The default value of a string array's elements is null.
سؤال
An array's size declarator must be a nonnegative integer number.
سؤال
You access the individual elements in an array by using their subscripts.
سؤال
An array's Length property is read only, so you cannot change its value.
سؤال
In C#, you cannot reassign an array reference variable to a different array.
سؤال
The ref keyword creates and object in memory and returns a reference to the object it creates.
سؤال
You can create an array to hold any one type of value.
سؤال
When reading the contents of a file into an array, the loop should iterate until either the array is filled or the end of the file is reached.
سؤال
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 with a regular for loop.
سؤال
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.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/99
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 7: Arrays and Lists
1
When you create a numeric array in C#, what value are its elements set to by default?

A) null
B) 0
C) 255
D) -1
B
2
When you create an array, you can optionally initialize it with a group of values called a(n) ____________.

A) initialization list
B) default group
C) element assembly
D) starting run
A
3
When you are working with a(n) ____________ variable, the compiler sets aside, or allocates, a chunk of memory that is big enough for that variable.

A) reference type
B) uninitialized
C) value type
D) dynamic type
C
4
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
5
What special value are the elements of an array of reference type objects set to by default?

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

A) values
B) sectors
C) compartments
D) elements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
7
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
8
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
9
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
10
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
11
A(n) ____________ is an object that can hold a group of values that are all the same data type.

A) matrix
B) list
C) array
D) container
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
12
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
13
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();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
14
A(n) ____________ is a special value that links a variable to an object.

A) linker
B) reference
C) operator
D) delimiter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
15
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
16
Each element in an array is assigned a unique number known as a(n) ____________.

A) subscript
B) identifier
C) delimiter
D) vector
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
17
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
18
Which one of the following statements declares a reference variable named values that can be used to reference an int array?

A) int values[];
B) values[int];
C) int[] values;
D) int [values];
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 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 assigns the value 40 to the first element in an int array named values?

A) values[-1] = 40;
B) values[0] = 40;
C) values[null] = 40;
D) values[1] = 40;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
21
____________ is a process that periodically runs, removing all unreferenced objects from memory.

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

A) random search
B) quick sort
C) binary search
D) combinatorial search
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
23
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
24
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) referential protocols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
25
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
26
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
27
To successfully ____________ the contents of two variables, we need a third variable that can serve as a temporary storage location.

A) copy
B) swap
C) reference
D) remove
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
28
To compare the contents of two arrays, you must compare the ____________ of the two arrays.

A) memory locations
B) reference variables
C) elements
D) size
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
29
In C#, all arrays have a(n) ____________ that is set to the number of elements in the array.

A) Element property
B) getSize method
C) Length property
D) GetBounds method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
30
When you call a method and pass an array as an argument, you simply pass the____________ that references the array.

A) data
B) method
C) variable
D) class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
31
When you process a(n) ____________, you must process only the elements that contain valid items.

A) partially filled array
B) reference copy
C) sequential search
D) Boolean expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
32
____________ arrays, which are also called 2D arrays, can hold multiple sets of data.

A) Double-data
B) Two-dimensional
C) Row-column
D) Duel-derivative
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
33
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
34
When only a reference of an object is copied and not the contents of the object itself, it is called a(n) ____________.

A) shadow copy
B) memory copy
C) error copy
D) reference copy
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
35
The ____________ uses a loop to sequentially step through an array, starting with the first element.

A) sequential search algorithm
B) top-down algorithm
C) simple search algorithm
D) basic array traversal algorithm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
36
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
37
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
38
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
39
With what value should the accumulator variable be initialized to calculate the total of the values in a numeric array?

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

A) One-dimensional
B) Two-dimensional
C) Data bound
D) Classical
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
41
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
42
All the data types in C# − and the underlying .NET Framework − fall into two categories: value types and reference types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
43
The memory that is allocated for a reference type variable is the actual location that will hold any value that is assigned to that variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
44
Reference variables can be used only to reference objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
45
If you want to remove all the items from a List, you can call the ____________ method.

A) Clear
B) Reset
C) ClearAll
D) NewList
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
46
A(n) ____________ is similar to an array but offers many advantages over an array.

A) List object
B) Collection
C) Random object
D) jagged array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
47
A List object has a(n) ____________ that holds the number of items stored in the List.

A) Count property
B) Total property
C) reference variable
D) extra memory location
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
48
To add items to an existing List object, you use the ____________.

A) += operator
B) & operator
C) Insert property
D) Add method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
49
You can use the ____________ to remove an item at a specific index in a List.

A) Delete method
B) RemoveAt method
C) null keyword
D) Erase property
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
50
You can store a mixture of data types in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
51
You can use the ____________ to insert an item at a specific index in a List.

A) + operator
B) Add method
C) Insert method
D) Place property
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
52
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
53
Because variables hold only a single value, they can be cumbersome in programs that process lists of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
54
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
55
Which one of the following statements creates a List object, named friendsList, that can be used to hold strings?

A) string friendsList = new List;
B) friendsList(string);
C) List friendsList = new List;
D) List friendsList = new List();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
56
List objects, like arrays, are always passed to a method ____________.

A) by value
B) in memory
C) by reference
D) globally
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
57
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
58
Look at the following code sample: int[,] values = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 } };
What is the value stored in values[2, 2]?

A) 2
B) 3
C) 6
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
59
If you know the value of the item that you want to remove from a List, but you do not know the item's index, you can use the ____________.

A) - operator
B) Erase method
C) Remove method
D) -= operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
60
Creating a reference type object typically requires the following two steps:
1. You declare a reference variable.
2. You create the object and associate it with the reference variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
61
When processing the contents of an array, there are some circumstances in which the foreach loop is not adequate, and the for loop should be used instead.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
62
When you use either the ref or out keywords with an array parameter, the receiving method not only has access to the array, but it also has access to the reference variable that was used to pass the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
63
When working with an array, you cannot use a subscript that is less than 0 or greater than the size of the array minus 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
64
The first element in an array is assigned the subscript 1, the second element is assigned the subscript 2, and so forth.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
65
Writing the contents of an array to a file is a straightforward procedure: Open the file and use a loop to step through each element of the array, writing its contents to the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
66
Arrays are reference type objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
67
Arrays are always passed by value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
68
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
69
The sequential search algorithm is the simplest of all search algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
70
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
71
The default value of a string array's elements is null.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
72
An array's size declarator must be a nonnegative integer number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
73
You access the individual elements in an array by using their subscripts.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
74
An array's Length property is read only, so you cannot change its value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
75
In C#, you cannot reassign an array reference variable to a different array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
76
The ref keyword creates and object in memory and returns a reference to the object it creates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
77
You can create an array to hold any one type of value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
78
When reading the contents of a file into an array, the loop should iterate until either the array is filled or the end of the file is reached.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
79
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 with a regular for loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.
فتح الحزمة
k this deck
80
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
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 99 في هذه المجموعة.