
Loops (Nested too)
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Raymond Chan
Used 488+ times
FREE Resource
Enhance your content
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
5 4 3 2 1
-5 -4 -3 -2 -1
-4 -3 -2 -1 0
None of the above
2.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the following code segment. Which of the following can be used as a replacement for the missing loop header so that the loop prints out “0 2 4 6 8 10”?
while (count == 10)
while (count < 10)
while (count <= 10)
while (count > 10)
3.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the following code segment. What is count’s value after running this code segment?
0
1
16
6
4.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
for (int i = 3; i < 8; i++)
{
System.out.print(i + " ");
}
3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
8 8 8 8 8
3 4 5 6 7
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
7 rows with 5 columns
7 rows with 4 columns
6 rows with 5 columns
6 rows with 4 columns
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
A rectangle of 4 rows with 3 star per row.
A rectangle of 5 rows with 3 stars per row.
A rectangle of 4 rows with 1 star per row.
The loops have errors.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the values of var1 and var2 when the code finishes executing?
var1 = 1, var2 = 1
var1 = 2, var2 = 0
var1 = 3, var2 = -1
var1 = 0, var2 = 2
The loop will cause a run-time error with a division by zero.
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment. How many times is the string “Hi!” printed as a result of executing the code segment?
15
12
10
8
Similar Resources on Wayground
7 questions
DBMS
Quiz
•
10th Grade
12 questions
Hour of Code
Quiz
•
6th - 12th Grade
10 questions
10 CS // Pseudocode
Quiz
•
9th - 11th Grade
6 questions
Topic 4.3 Video 1
Quiz
•
11th Grade
10 questions
APCS 2023-2024 Lesson 0.2 Course Overview
Quiz
•
9th - 12th Grade
10 questions
Working with tables
Quiz
•
5th - 12th Grade
6 questions
Diagrama de flujo
Quiz
•
10th Grade
10 questions
Python Lists
Quiz
•
8th - 9th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade
