For Loops

For Loops

Assessment

Interactive Video

Computers

11th Grade

Hard

Created by

Myra Deister

FREE Resource

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 In the video, how many lines of code does Alex claim you need to write a for loop?

1 line

2 lines

3 lines

5 lines

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of a for loop in Java?

To define a method in Java.
To create a new class in Java.
To handle exceptions in Java.

To repeat code a specific number of times

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two key things you need to know when writing a for loop?

The variable name and the data type

The start value and end value

How many times to repeat and what to repeat

The increment value and the decrement value

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the basic for loop example, what does the number inside the parentheses represent?

The starting value

The ending value

The number of times to repeat the code

The increment value

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the name of the variable commonly used in for loops?

x

j

i

n

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the for loop syntax shown, what does "i++" mean?

Multiply i by 2

Add 1 to i

Subtract 1 from i

Divide i by 2