Question 1
- Potentially ambiguous operations
- Step 1 → how many tires do we buy? what kind?
- Step 2 → which tire do we change?
- Step 3 → to which point do we inflate the wheel?
- Step 4 → When is a wheel considered balanced?
- Step 5 → What operation(s) do we repeat?
- Modified pseudocode
- Buy 4 new tires of XXX characteristics
- For every new tire (4 tires)
- Inflate the wheel
- Balance the wheel
Question 2
C. The outcome is “you did it!”
Question 3
A. Byte code is given as input to the Java Virtual machine
Question 4
B. Java Virtual Machine is a compiler
Question 5
Either C or D
Question 6
public static int max(int data[10]) { int max = 0; for (int i = 0; i < data.length(); i++) { if (array[i] > max) { max = array[i]; } } return max[]; }
Question 7
index | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|---|
value | 10 (? or -1?) | 2 | 3 | 1 | 3 | 0 | 2 |