What are the three general types of looping structures?

B4 - The for Statement

Quiz
•
Other
•
University
•
Easy

Ahmetcan türk
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
counting loop, sentinel-controlled loop, and result-controlled loop.
infinite loop, counting loop, nested loop
while loop, for loop, do loop
count up loop, count down loop, infinite loop
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program fragment?
int j;
for ( j = 0; j < 5; j++ )
{
System.out.print( j + " " );
}
System.out.println( );
1 2 3 4 5
0 1 2 3 4
0 1 2 3 4 5
j j j j j
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment?
int j;
for ( j = 10; j > 5; j-- )
{
System.out.print( j + " " );
}
System.out.println( );
10 11 12 13 14 15
9 8 7 6 5 4 3 2 1 0
10 9 8 7 6 5
10 9 8 7 6
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What must the test be so that the following fragment prints out the integers 5 through and including 15?
int j;
for ( j = 5; ________ ; j++ )
{
System.out.print( j + " " );
}
System.out.println( );
j<15
j<=16
j<16
j==15
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What must the change be so that the following fragment prints out the even integers 0 2 4 6 8 10?
int j;
for ( j = 0; j <= 10; _______ )
System.out.print( j + " " );
System.out.println( );
j+2
j = j+2
j++++
++j++
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What must the initialization be so that the following fragment prints out the integers -3 -2 -1 ?
int j;
for ( _______ ; j < 0; j++ )
System.out.print( j + " " );
System.out.println( );
j = 0
j < 0
j = -3
j = -4
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment?
int j;
for ( j = 5; j > -5; j-- )
System.out.print( j + " " );
System.out.println( );
-5 -4 -3 -2 -1 0
5 4 3 2 1 0
5 4 3 2 1 0 -1 -2 -3 -4 -5
5 4 3 2 1 0 -1 -2 -3 -4
Create a free account and access millions of resources
Similar Resources on Quizizz
14 questions
Comm Skills for CJ - Chapter 9

Quiz
•
University
10 questions
B4 - Common Array Algorithms

Quiz
•
University
15 questions
Java Debugging Questions - M

Quiz
•
University
10 questions
Diuretics

Quiz
•
University
10 questions
Java set3

Quiz
•
University
10 questions
Computational Thinking for Problem Solving

Quiz
•
University
15 questions
Quiz on Object Oriented Programming and Java

Quiz
•
University
10 questions
POST TEST MODULE 4

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade