
B4 - The for Statement
Authored by Ahmetcan türk
Other
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the three general types of looping structures?
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Le langage SMS
Quiz
•
9th Grade - Professio...
15 questions
MIS Chapter 6 Review
Quiz
•
University
15 questions
Pase de Salida
Quiz
•
KG - University
14 questions
Linéaires et IS
Quiz
•
University
15 questions
Avengers quiz
Quiz
•
3rd Grade - Professio...
15 questions
İleri Uzman Seviye Excel Testi
Quiz
•
University
10 questions
Guillermo del Toro, conocimiento generales.
Quiz
•
University
15 questions
Evaluación del Libro de Daniel
Quiz
•
12th Grade - Professi...
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Other
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University