Search Header Logo

For Loops HW

Authored by Coral Riley

Computers

9th - 12th Grade

Used 2+ times

For Loops HW
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this block of code do?
for( int i = 0; i < 10; i++)
  out.println("hello");

Prints the String "hello" ten times.
Prints the String "hello"
Heebee Jeebies
Nothing. The code does not run.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the loop types below IS NOT recognized in Java.

while
do-while
for
repeat

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the index variable?
int start, qti = 0;
                   for(int i = start; i < 5; i++)
qti++;

i
qti
start
5

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an index variable in programming?

A variable that changes every time a loop runs until the loop condition is false.
A variable that keeps track of a textbook page number.
An iterator
Tomfoolery

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the loop condition for this code?
for(int i = 0; i <= 3; i++)
                out. print("sup");

int i = 0
i <= 3
i++
out.print("sup")

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

True/False
If a loop condition is never satisfied then the loop does not execute.

True
False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will this loop run?
for(int i = 2; i < 11; i++)
        out. print("foo");

7
8
9
10

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?