Hard Multiple Choice QuestionsΒΆ

These problems are harder than most of those that you will usually see on the AP CS A exam.

3-11-1: Which of the following would be the correct result from the following expression: 150 (in decimal) - 21 (in octal) + 101 (in binary) - E (in hexadecimal)?

The following question assumes you know about arrays and methods. You can skip it if you haven’t covered these yet and come back when you have.

3-11-2: Given the following code are the contents of itemArray and val after a call of mod(itemArray,val)?

int[] itemArray = {9, 8, 7, 6};
int val = 5;

public static void mod(int[] a, int value)
   for (int i=0; i < a.length; i++)
      a[i] = i;
   value = a[a.length-1];