Page 606 - AP Computer Science A, 7th edition
P. 606

public void remove(int index) {
int[] b = new int[arr.length – 1]; int count = 0;
for (int i = 0; i < arr.length; i++) {
if (i != index) {
b[count] = arr[i];
count++; }
}
/∗ assertion ∗ / arr = b;
}
Which of the following assertions is true when the /∗ assertion
∗ / line is reached during execution of remove?
(A) b[k] == arr[k] for 0 <= k < arr.length.
(B) b[k] == arr[k + 1] for 0 <= k < arr.length.
(C) b[k] == arr[k] for 0 <= k <= index, and b[k] == arr[k
+ 1] for index < k < arr.length – 1.
(D) b[k] == arr[k] for 0 <= k < index, and b[k] == arr[k
+ 1] for index <= k < arr.length – 1.
(E) b[k] == arr[k] for 0 <= k < index, and b[k] == arr[k
+ 1] for index <= k < arr.length.
34. When an integer is represented in base 16 (hexadecimal), the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F are used, where A–F represent the numbers 10–15. If base 16 is represented with the subscript hex and base 10 is represented with the subscript dec, then the decimal number 196 could be represented in hexadecimal as shown below:
196dec = C4hex














































































   604   605   606   607   608