Exam 8: Arrays;Introduction to Exception Handling

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Passing a reference with keyword ref gives the called method control over the passed reference itself.

(True/False)
4.9/5
(33)

What do the following statements do Double[] array; Array = new double[14];

(Multiple Choice)
4.8/5
(37)

Which of the following initializer lists would correctly set the elements of array n

(Multiple Choice)
4.8/5
(41)

[C#6] Which of the following statements is false

(Multiple Choice)
4.8/5
(41)

When a C# program executes,the runtime checks array element indices for validity-all indices must be greater than or equal to 0 and less than the length of the array.Any attempt to access an element outside that range of indices results in a runtime error known as a(n)________.

(Multiple Choice)
5.0/5
(37)

Which method call does the method header void ModifyArray(double[] b) represent ? Assume that the array being passed in is already defined and is called list.

(Multiple Choice)
4.7/5
(41)

What is the proper foreach header format

(Multiple Choice)
4.8/5
(21)

Which of the following statements is false

(Multiple Choice)
4.9/5
(33)

Each reference in an array of references is set to null by default when the array is allocated.

(True/False)
4.9/5
(30)

Which expression adds 1 to the element of array arrayName at index i,assuming the array is of type int

(Multiple Choice)
4.9/5
(31)

Which of the following statements about creating arrays and initializing their elements is false

(Multiple Choice)
4.8/5
(33)

Consider the class below: Class Test { Static void Main() { Int[] a = new int[10]; For (int i = 0;i < a.Length;++i) { A[i] = i + 1 * 2; } Int result = 0; For (int i = 0;i < a.Length;++i) { Result += a[i]; } Console.WriteLine($"Result is: {result}"); } } The output of this C# program will be:

(Multiple Choice)
4.9/5
(29)

Which foreach header represents iterating through an array of int named numbers

(Multiple Choice)
4.8/5
(36)

If you want to pass an array element into a method by reference,what will you need to do

(Multiple Choice)
4.9/5
(35)

When accessing an element of an array,operations (calculations)are not allowed inside the brackets of an array.

(True/False)
4.8/5
(29)

When an app is executed from the Command Prompt,the execution environment passes the command-line arguments to the Main method as a string.

(True/False)
4.8/5
(35)

In an array of reference types,each element may be a reference to a different type.

(True/False)
4.9/5
(33)

Consider integer array values,which contains 5 elements.Which statements successfully swap the contents of the array at index 3 and index 4

(Multiple Choice)
4.8/5
(36)

Consider the class below: Class Test { Static void Main() { Int[] a = {99,22,11,3,11,55,44,88,2,-3}; Int result = 0; For (int i = 0;i < a.Length;++i) { If (a[i] > 30) { Result += a[i]; } } Console.WriteLine($"Result is: {result}"); } } The output of this C# program will be:

(Multiple Choice)
4.9/5
(34)

The first element in every array is the 0th element.

(True/False)
4.7/5
(31)
Showing 21 - 40 of 90
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)