Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12. How many components are in the array numList seen in the accompanying figure

ID: 3762083 • Letter: 1

Question

12.

How many components are in the array numList seen in the accompanying figure?

a.

c.

b.

d.

13.

What is the index number of the last component in the array numList seen in the accompanying figure?

a.

c.

b.

d.

14.


int[] list = {0, 5, 10, 15, 20};

for (int j = 0; j < 5; j++)
    System.out.print(list[j] + " ");

a.

c.

b.

d.

15.

What is the value of alpha[4] after the following code executes?

int[] alpha = new int[5];

for (int j = 0; j < 5; j++)
    alpha[j] = 2 * j - 1;

a.

c.

b.

d.

12.

How many components are in the array numList seen in the accompanying figure?

a.

0

c.

49

b.

30

d.

50 ABCD

13.

What is the index number of the last component in the array numList seen in the accompanying figure?

a.

0

c.

49

b.

30

d.

50 ABCD

14.

What is the output of the following Java code?


int[] list = {0, 5, 10, 15, 20};

for (int j = 0; j < 5; j++)
    System.out.print(list[j] + " ");

System.out.println();

a.

0 1 2 3 4

c.

0, 5, 10, 15, 20

b.

0 5 10 15 20

d.

0 5 10 15 ABCD

15.

What is the value of alpha[4] after the following code executes?

int[] alpha = new int[5];

for (int j = 0; j < 5; j++)
    alpha[j] = 2 * j - 1;

a.

one

c.

five

b.

three

d.

seven

Explanation / Answer

12. Figure is not specified
13. Figure is not specified, but index will be size - 1
14. 0 5 10 15 20
15. alpha[4] = 2*4 - 1 = 7