9.2.4. Arrays-WE2-P4ΒΆ
Subgoals for Evaluating Arrays
Set up array from 0 to size-1
Evaluate data type of statements against array
Trace statements, updating slots as you go
Remember assignment subgoals
Arrays-WE2-P4
Assume the following given declarations:
int [] alpha;
Give the contents of alpha after the execution of these statements.
alpha = new int[5];
for (int i = 0; i < 5; i++)
alpha[i] = i + 1;
Q26: The value of alpha[0] is |blank|
.
Q27: The value of alpha[1] is |blank|
.
Q28: The value of alpha[2] is |blank|
.
Q29: The value of alpha[3] is |blank|
.
Q30: The value of alpha[4] is |blank|
.
You have attempted of activities on this page