Exam 6: Using Arrays

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

Arrays are useful when you need to store just one value in memory at a time.

Free
(True/False)
4.9/5
(37)
Correct Answer:
Verified

False

To use the Sort() method, you pass the array name to ____.

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

C

How can you change the size of an array in C#?

Free
(Essay)
4.8/5
(40)
Correct Answer:
Verified

You can change the size of an array associated with an identifier, if necessary. For example, if you declare int [] array; , you can assign five elements later with array = new int [5]; ; later in the program, you might alter the array size to 100 with array = new int [100]; . Still later, you could alter it again to be either larger or smaller. This feature is not allowed in most other programming languages. If you resize an array in this manner, the same identifier refers to a new array in memory and all the values are set to 0.

In a ____ array, each row has the same number of columns.

(Multiple Choice)
4.8/5
(36)

You can assign nondefault values to array elements at declaration by specifying a list of values called a(n) ____.

(Multiple Choice)
4.8/5
(42)

When using an array in a GUI program, if array values will change based on user input, the array must be ____ any method that reacts to the user's event.

(Multiple Choice)
4.8/5
(38)

You can distinguish each element from the others in an array with a(n) ____.

(Multiple Choice)
4.8/5
(45)

Explain how to use a for loop to perform an arithmetic operation on each element in an array.

(Essay)
4.9/5
(35)

The power of arrays becomes apparent when you use subscripts that are variables rather than constant values.

(True/False)
4.9/5
(44)

A(n) ____________________ array has the same number of elements as an existing array and uses the same subscript to access additional information.

(Short Answer)
4.9/5
(31)

Explain how to assign a value to a specific array element and how to print it.

(Essay)
4.7/5
(35)

The ____________________ property is a member of the System.Array class and automatically holds an array's length.

(Short Answer)
4.9/5
(52)
Match each item with a statement below:
Each object in an array
element 0
A term used by mathematicians to refer to a two-dimensional array
range match
Determining the pair of limiting values between which another value falls
Length - 1
Correct Answer:
Verified
Premises:
Responses:
Each object in an array
element 0
A term used by mathematicians to refer to a two-dimensional array
range match
Determining the pair of limiting values between which another value falls
Length - 1
The default value of an array's numeric field
Reverse() method
The index of the last element in an array
subscript
Reverses the order of items in an array
0
Requires multiple subscripts to access array elements
matrix
The first element in an array
array element
Also known as an index
multidimensional array
(Matching)
4.9/5
(41)

A search in which each array element is examined in order is called a ____ search.

(Multiple Choice)
4.9/5
(47)

Describe the circumstances where you can use the foreach statement.

(Essay)
4.8/5
(34)

With the foreach statement, you provide a temporary ____ that automatically holds each array value in turn.

(Multiple Choice)
4.9/5
(36)

Explain how to use a for loop to search an array for an exact match.

(Essay)
4.8/5
(31)

In C#, arrays are objects.

(True/False)
4.9/5
(38)

When you declare objects, their character fields initialize to ____.

(Multiple Choice)
4.8/5
(37)

You can easily navigate through arrays using a for or while loop that varies a subscript from 0 to ____.

(Multiple Choice)
4.8/5
(35)
Showing 1 - 20 of 42
close modal

Filters

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