Search Header Logo

CS2 Arrays Review

Authored by Donna Panter

Computers

9th - 12th Grade

Used 1+ times

CS2 Arrays Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println( array[0] );

5

7

11

syntax error

out of bounds exception

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println( array[1] );

5

7

11

syntax error

out of bounds error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println( array[5/2] );

5

7

8

syntax error

out of bounds error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println(array[array.length-1]);

4

11

8

syntax error

out of bounds error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println(array[array.length]);

4

11

8

syntax error

out of bounds exception

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

out.println(array.length);

4

2

3

1

5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output by the code below?

 

int[] array = {5,7,8,11,4};

for(int i=0; i<array.length/2; i=i+2)

{  

   array[i]=array[array.length-i-1];

}

System.out.println(array[0]);

5

7

8

4

11

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?