Question Bank · Unit 2
AP® Computer Science A Selection and Iteration Practice Questions
Work through AP Computer Science A practice questions on Selection and Iteration, then check each answer against a worked solution.
Free · no sign-up
Open questions need no account. Sign up or log in to open the rest.
All 740
Multiple choice 692
Free response 48
Subtopic: Iteration
Clear filter
Which of the following code…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following two code segments. Assume that the int variables m and n have been properly declared and initialized and are both greater than 0. I. for…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. Assume that num3 > num2 > 0. int num1 = 0; int num2 = /* initial value not shown */; int num3 = /* initial value not…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. for (int r = 3; r > 0; r--) { int c; for (c = 1; c < r; c++) { System.out.print("-"); } for…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. for (int outer = 1; outer <= 6; outer++) { for (int inner = outer; inner <= 6; inner++) { if…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. int count = 0; for (int x = 0; x < 4; x++) { for (int y = x; y < 4;…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. int value = 15; while (value < 28) {…
Sign up now. It's free!
See the full question with its answer and worked solution.
int k = a random number such that 1 ≤ k ≤ n ; for (int p = 2; p <= k; p++) for (int r = 1; r < k;…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. int k = 0; while (k < 10) { System.out.print((k % 3) + " ");…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following code segment. for (int outer = 0; outer < n; outer++) { for (int inner = 0; inner <= outer; inner++) {…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 1 of 39
Get your FRQs graded in the Student Portal
In the Verityprep Student Portal, answer the FRQs of AP practice and past exams by typing or uploading a photo. A teacher grades them with that year's official College Board scoring guidelines and gives you an estimated 1–5 score.
Join Verityprep now
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.