Search Header Logo

Lists, Loops, & Traversals Quiz | AP CSP

Authored by Isidore Hernandez

Computers

9th - 12th Grade

Used 28+ times

Lists, Loops, & Traversals Quiz | AP CSP
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

The code segment has three missing values: <COUNTER>, <AMOUNT>, and <STEP>. What must be the missing values to display 7 8 8 9?

<COUNTER> = 1,

<AMOUNT> = 2,

<STEP> = 1

<COUNTER> = 1,

<AMOUNT> = 7,

<STEP> = 1

<COUNTER> = 7,

<AMOUNT> = 2,

<STEP> = 1

<COUNTER> = 7,

<AMOUNT> = 4,

<STEP> = 1

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of these code segments is an example of an infinite loop when x = 10 and y = 5?

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Which of the following line of code replace <INSERT CODE> to display all the items inside of list?

i < list[list.length]

i < list.length

i <= list[0]

i < list.length - 1

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What will be displayed to the console when the following program runs?

0 2 4 6 8 10

2 4 6 8

0 2 4 6 8

2 4 6 8 10

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What will be displayed in the console after this program runs?

[9, 32, 39]

[8, 9, 32, 39]

[8, 32, 37, 39]

[8, 32, 37]

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What will be the value of sum after this code runs?

21

6

7

15

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following code segments prints out "hello" 10 times to the console?

Media Image
Media Image
Media Image
Media Image

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?