Consider the two-by-three rectangular integer array t.
a) Write a statement that declares t and creates the array.
b) How many rows does t have?
c) How many columns does t have?
d) How many elements does t have?
e) Write the names of all the elements in row 1 of t.
f) Write the names of all the elements in column 2 of t.
g) Write a single statement that sets the element of t in row 0 and column 1 to zero.
h) Write a sequence of statements that initializes each element of t to 1. Do not use a repetition statement.
i) Write a nested for statement that initializes each element of t to 3.
```
a) int[,] t = new int[2, 3];
b) two.
c) three.
d)six.
e) t[1, 0], t[1, 1], t[1, 2]
f) t[0, 2], t[1, 2]
g) t[0, 1] = 0;
h)
t[0, 0] = 1;
t[0, 1] = 1;
t[0, 2] = 1;
t[1, 0] = 1;
t[1, 1] = 1;
t[1, 2] = 1;
i)
for (int j = 0; j < t.GetLength(0); j++)
{
for (int k = 0; k < t.GetLength(1); k++)
{
t[j, k] = 3;
}
}
```
You might also like to view...
When setting the resolution of an image, you can specify the number of ____ per inch, or per centimeter.
a. pixels b. samples c. units d. gradients
The ____ is the tool you use in Flash to coordinate a document's layers and frames.
A. Timeline B. Guide C. Layer Manager D. Mask
Which of the following kinds of software consists of the programs that control or maintain the operations of a computer and its devices?
A. system B. application C. management D. program
Discuss the National Security Professional Development Program (NSPD).
What will be an ideal response?