Answer the following statements true (T) or false (F)

1. In a sorting an array, the items in the array are rearranged so that
```
for all j and k, if j < k, then array[j]<=array[k]```
2. In the definition, double d[10] = {0.0}; only d[0] is initialized to zero,
the rest are uninitialized, just like x in the definition double x;
3. If you need an array with more than one index, you can use a multidimensional array,
which is actually an array of arrays. In the explanation, declare an array of doubles
with 2 rows and 5 columns.
4. Indexed variables for an array are stored wherever the computer finds memory for the
first indexed variable, then the next one is stored next to the first if there is space, and
someplace else if not.
5. C++ arrays check for out-of-range index values.


1. True
This is sorting into increasing order. This ignores sorting into decreasing order. Care should be taken not to compare elements with index values out of the
range 0 to declared_size-1
2. False
The ISO C++ Standard requires that a Standard compliant compiler with
an initializer list initialize the excess array elements to a zero value appropriate to the
base array type. Most compilers comply.
3. True
Perhaps the easiest way to see this is to think of a two dimensional array
as an array of lines on a page. The requested declarations is
double array[2][5];
The first index is the row, or line number, and the second index is the column position
within that row.
4. False
Indexed variables of an array are stored contiguously, or next to each
other.
5. False.
C++ array access is directly to memory through addresses, and is
designed to be as efficient as possible. The C++ Standard does not require a
mechanism to detect out-of-range index values. Finally, no version of C++ this writer
is aware of provides this feature.

Computer Science & Information Technology

You might also like to view...

A server manages the objects a1, a2,... an. The server provides two operations for its clients:

read (i) returns the value of ai; write(i, Value) assigns Value to ai. The transactions T and U are defined as follows: T: x= read (j); y = read (i); write(j, 44); write(i, 33); U: x= read(k); write(i, 55); y = read (j); write(k, 66). Give three serially equivalent interleavings of the transactions T and U.

Computer Science & Information Technology

Represent an image from its most characteristic angle when designing an icon.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

On a network, which protocol is responsible for dividing files into chunks, adding headers containing information for reassembling packets in their original order, and error checking?

A. UDP B. IP C. TCP D. FTP (File Transfer Protocol)

Computer Science & Information Technology

What must be entered when you install software to verify that the software was purchased legally?

a. Administrator password b. Product key c. Credit card number

Computer Science & Information Technology