1. When you place objects in order beginning with the object with the highest va
ID: 652746 • Letter: 1
Question
1. When you place objects in order beginning with the object with the highest value,
you are sorting in order.
a. acquiescing
b. ascending
c. demeaning
d. descending
2. Using a bubble sort involves .
a. comparing parallel arrays
b. comparing each array element to the average
c. comparing each array element to the adjacent array element
d. swapping every array element with its adjacent element
3. When you use a bubble sort to perform an ascending sort, after the first pass
through an array the largest value is .
a. at the beginning of the list
b. in the middle of the list
c. at the end of the list
d. It is impossible to determine the answer without more information.
4. When you use a bubble sort to perform an ascending sort, after the first pass
through an array the smallest value is .
a. at the beginning of the list
b. in the middle of the list
c. at the end of the list
d. It is impossible to determine the answer without more information.
5. When array elements are objects, you usually want to sort based on a
particular of the object.
a. field
b. method
c. name
d. type
6. The following defines a array:
int[][]nums={{1, 2}, {3, 4}, {5, 6}};
a. one-dimensional
b. two-dimensional
c. three-dimensional
d. six-dimensional
7. How many rows are contained in the following array?
double[][] prices = {{2.56, 3.57, 4.58, 5.59},
{12.35, 13.35, 14.35, 15.00}};
a. 1
b. 2
c. 4
d. 8
8. How many columns are contained in the following array?
double[][] prices = {{2.56, 3.57, 4.58, 5.59},
{12.35, 13.35, 14.35, 15.00}};
a. 1
b. 2
c. 4
d. 8
9. In the following array, what is the value of code[2][1]?
char[][] code = {{ 'A ', 'D ', 'M '},
{ 'P ', 'R ', 'S '},
{ 'U ', 'V ', 'Z '}};
a. 'P'
b. 'R'
c. 'U'
d. 'V'
10. In the following array, what is the value of address[1][1]?
String address = {{ "123 Oak ", "345 Elm "},
{ "87 Maple ", "901 Linden "}};
a. "123 Oak "
b. "345 Elm "
c. "87 Maple "
d. "901 Linden "
11. In the following array, what is the value of fees.length?
double[][] fees = {{3.00, 3.50, 4.00, 5.00},
{6.35, 7.35, 8.35, 9.00}};
a. 2
b. 4
c. 8
d. none of the above
12. In the following array, what is the value of fees[1].length?
double[][] fees = {{3.00, 3.50, 4.00, 5.00},
{6.35, 7.35, 8.35, 9.00}};
a. 2
b. 4
c. 8
d. none of the above
13. You place after the data type in the parameter list of a method
that receives a two-dimensional array.
a. a pair of empty brackets
b. two pairs of empty brackets
c. a pair of brackets that contain the number of rows followed by a pair of
empty brackets
d. a pair of empty brackets followed by brackets that contain the number of
columns
14. A array has rows of different lengths.
a. ragged
b. jagged
c. haggard
d. tattered
15. If the value of credits[0].length is not equal to credits[1].length, you
know credits is .
a. a three-dimensional array
b. an uninitialized array
c. a partially populated array
d. a jagged array
16. Which of the following is true if a successfully running program contains the
following statement:
Arrays.fill(tax, 10);
a. tax is a two-dimensional array.
b. fill() is a nonstatic method.
c. tax is an array with 10 elements.
d. none of the above
17. Which of the following is a requirement when you use a binary search method
with an array?
a. The array must be numeric.
b. The array must have been sorted in ascending order.
c. The array must have at least three elements.
d. none of the above
18. The chief advantage to using the ArrayList class instead of the Arrays class is
that an ArrayList .
a. can be much larger
b. is easier to search
c. is dynamically resizable
d. can be used as an argument to a static method
19. The chief disadvantage to using the ArrayList class instead of the Arrays class is
that an ArrayList .
a. cannot be sorted
b. cannot store primitive data types
c. cannot be accessed using subscripts
d. All of the above are disadvantages to using an ArrayList.
20. An advantage to using an enumerated data type is .
a. errors are reduced because only a limited set of values can be used with
the type
b. time is saved because programs with enumerated types compile faster
c. coding time is reduced because enumerated types are created automatically
by the compiler
d. All of the above are true.
Explanation / Answer
1.
d. descending
2.
c. comparing each array element to the adjacent array element(swaping also occurs if current element is less than the next element)
3.
c. at the end of the list
4.
b. in the middle of the list('anywhere possible' will be more appropriate)
5.
a. field
6.
b. two-dimensional
7.
b. 2
8.
c. 4
9.
d. 'V'
10.
d. "901 Linden "
11.
a. 2
12.
b. 4
13.
b. two pairs of empty brackets
14.
b. jagged
15.
d. a jagged array
16.
d. none of the above
17.
b. The array must have been sorted in ascending order.
18.
c. is dynamically resizable
19.
c. cannot be accessed using subscripts
20.
d. All of the above are true.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.