Skip to main content

Section 9.4 Arrays-WE2-P1

Subsection 9.4.1 Subgoals for Evaluating Arrays

  1. Set up array from 0 to size-1
  2. Evaluate data type of statements against array
  3. Trace statements, updating slots as you go
    1. Remember assignment subgoals

Subsection 9.4.2 Arrays-WE2-P1

Assume the following given declarations:
int [] alpha;
Give the contents of alpha after the execution of these statements.
alpha = new int[10];
for (int i = 0; i < 10; i++)
    alpha[i] = i * i;

Exercises Exercises

1.
Q4: Enter the values of alpha in the blanks.
2.
Q5: Enter the values of alpha in the blanks.
3.
Q6: Enter the values of alpha in the blanks.
4.
Q7: Enter the values of alpha in the blanks.
5.
Q8: Enter the values of alpha in the blanks.
6.
Q9: Enter the values of alpha in the blanks.
7.
Q10: Enter the values of alpha in the blanks.
8.
Q11: Enter the values of alpha in the blanks.
9.
Q12: Enter the values of alpha in the blanks.
10.
Q13: Enter the values of alpha in the blanks.
You have attempted of activities on this page.