for and while loops level 2

for and while loops level 2

Assessment

Flashcard

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

11 questions

Show all answers

1.

FLASHCARD QUESTION

Front

The x variable in the FOR LOOP starts at what value?

Media Image

Back

0

2.

FLASHCARD QUESTION

Front

The x variable in the FOR LOOP ends at what value?

Media Image

Back

30

3.

FLASHCARD QUESTION

Front

The x variable in the FOR LOOP increments by how much after each iteration of the loop?

Media Image

Back

10

4.

FLASHCARD QUESTION

Front

The variable s is initialized before the FOR LOOP starts. What value is the starting value for s?

Media Image

Back

0

5.

FLASHCARD QUESTION

Front

What LINE in the given code INITIALIZES s?

Media Image

Back

int s = 0;

6.

FLASHCARD QUESTION

Front

What LINE in the given code INCREMENTS s? Options: int s= 0;, for(int x=0; x<=30; x=x+10){, s=s+x;, System.out.println(x+" "+s);

Media Image

Back

s=s+x;

7.

FLASHCARD QUESTION

Front

What is the FIRST line of the output produced by this code? Options: 0 10, 0 0, x s, 10 30

Media Image

Back

0 0

Create a free account and access millions of resources

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?