9.2.3. Arrays-WE2-P3ΒΆ
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-P3
Assume the following given declarations:
int [] gamma;
Give the contents of alpha after the execution of these statements.
gamma = new int[6];
gamma[0] = 50;
for (int i = 1; i < 6; i++)
gamma[i] = gamma[i-1] - 5;
Q20: The value of gamma[0] is |blank|
.
Q21: The value of gamma[1] is |blank|
.
Q22: The value of gamma[2] is |blank|
.
Q23: The value of gamma[3] is |blank|
.
Q24: The value of gamma[4] is |blank|
.
Q25: The value of gamma[5] is |blank|
.
You have attempted of activities on this page