
AP Computer Science A Unit 4 Section 1 (While loops)
Authored by Christian Willaum
Computers
10th - 12th Grade
Used 250+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
About
This quiz focuses on while loops in Java programming, specifically targeting AP Computer Science A Unit 4 content appropriate for grades 10-12. The questions assess students' understanding of loop execution, iteration control, and program tracing skills essential for advanced high school computer science. Students need to demonstrate mastery of loop syntax, conditional expressions, variable manipulation within loops, and the ability to trace through code execution step-by-step. The core concepts include understanding how while loop conditions control program flow, recognizing when loops will terminate versus run infinitely, manipulating counter variables, and implementing algorithms that process numeric data through iteration. These problems require students to analyze code segments, predict output, and identify correct loop conditions for specific computational tasks. Created by Christian Willaum, a Computers teacher in US who teaches grade 10-12. This assessment serves multiple instructional purposes in an AP Computer Science A classroom, functioning effectively as a formative assessment tool, homework assignment, or review activity before summative evaluations. Teachers can deploy this quiz as a warm-up exercise to gauge student readiness for more complex loop applications or use it during guided practice sessions to reinforce proper while loop implementation. The question format mirrors AP exam style, providing valuable test preparation while building student confidence with trace tables and code analysis techniques. This quiz aligns with College Board standards for AP Computer Science A, specifically addressing learning objectives related to iterative algorithms and program control structures that form the foundation for more advanced programming concepts.
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What, if anything, is printed as a result of executing the code segment?
21
161116
161161
16111621
Nothing is printing because of an infinite loop.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the value of count after executing the code segment?
6
5
4
1
0
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
This code segment is intended to store the sum of all multiples of 10 between 10 and 100, inclusive (10 + 20 + ... + 100), in the variable total.
What should /* missing code */ be?
x < 100
x <= 100
x > 10
x >= 10
x != 10
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
This code is intended to print the sum of the digits in num. For example, when num is 12345, the code segment should print 15, which represents the sum 1 + 2 + 3 + 4 + 5.
What should /* missing loop header */ be?
while (num > 0)
while (num >= 0)
while (num > 1)
while (num > 2)
while (num > sum)
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What, if anything, is printed as a result of executing the code segment?
0
1
2
3
Nothing is printed.
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?
Popular Resources on Wayground
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
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade