C# When you pass an element from an ArrayList to a method, the method receives:
ID: 3757584 • Letter: C
Question
C#
When you pass an element from an ArrayList to a method, the method receives:
a copy of the full ArrayList
the address of the first element in the ArrayList
a copy of the value of that element stored in the ArrayList
the address of that element in the ArrayList
none of the above
1 points
QUESTION 2
A correct method call to a method that has the following heading would be:
int DoSomething(int[ , ] anArray, int num)
Write(DoSomething(anArray, 3));
DoSomething(anArray[ , ], 30);
Write(DoSomething(anArray[ ], 3));
DoSomething(anArray[ ], 30);
Write(DoSomething(anArray[ , ], 3));
1 points
QUESTION 3
Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray.Length);
1 points
QUESTION 4
In order to place a new element in an ArrayList use the ___________ method:
1 points
QUESTION 5
Assume an integer array named bArray was dimensioned to store 10 rows and 2 columns. Use a variable named element to reference individual cells. Fill in the blanks below for the foreach loop which might be used to display the contents of the array.
foreach( ) .
4 points
QUESTION 6
Deskcheck this snippet of code and identify what value is returned by the method named result
int result(int [ , ] anArray)
{
int j = 0,
i = 0;
for (int r = 0; r < anArray.GetLength(0); r++)
for (int c = 0; c < anArray.GetLength(1); c++)
if (anArray[r, c] < anArray[i, j])
{
i = r;
j = c;
}
return i;
}
the row index of the largest element of array anArray
the value of the largest element of array anArray
the row index of the smallest element of array anArray
the column index of the smallest element of array anArray
the index of the last element greater than its predecessor
1 points
QUESTION 7
Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray.Rank);
1 points
QUESTION 8
Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, 2]);
1 points
QUESTION 9
With the following declaration:
int [ , ] ctn = {{30, 10, 20, 40, 60},
{55, 70, 90, 20, 10}};
the statement Write(“Result = “ + (cnt[0, 2] + cnt[1, 3])); will display
Result = 2020
Result = 40
Result = "cnt[0, 2] + cnt[1, 3]"
Result = 1090
none of the above
1 points
QUESTION 10
Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, 2 + 1] * exampleArray[0, 0]);
1 points
QUESTION 11
Using the following declaration:
char [ , ] charArray = {{'a', 'b', 'c', 'd', 'e'},
{'f', 'g', 'h', 'i', 'j'}};
what does charArray[1, 1] refer to?
a
f
b
g
none of the above
1 points
QUESTION 12
Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, exampleArray.GetLength(0) 2]);
a copy of the full ArrayList
the address of the first element in the ArrayList
a copy of the value of that element stored in the ArrayList
the address of that element in the ArrayList
none of the above
Explanation / Answer
As, it is chegg policy to answer four parts of an question. Hence , I am answering the first four questions and request you to post rest of them as different question. Thankyou.
1.) Copy of full ArrayList
2.) Write(DoSomething(anArray, 3));
3.) 12
4.) add(int)
Hence, these are the answers to the above questions.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.