Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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.

Questions 1,021–1,030 of 3,140
  1. 1021
  2. 1022
  3. 1023
  4. 1024
  5. 1025
  6. 1026
  7. 1027
  8. 1028
  9. 1029
  10. 1030

Question 1021

Multiple choice Unit 2: Selection and Iteration
Given the following code segment: int t = 13; while (t < 29) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1022

Multiple choice Unit 2: Selection and Iteration
Given the following code segment: int a = 5, b = 2, temp; for (int i = 1; i <= 4; i++) { temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1023

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: for(int i = 0; i < 3; i++) { for(int j = 1; j <= 7;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1024

Multiple choice Unit 2: Selection and Iteration
Consider the following Java method, conditionTest, which takes two integer arguments, num1 and num2, and prints a letter based on their values: public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1025

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: for (int i = 0; i = 1; j--)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1026

Multiple choice Unit 2: Selection and Iteration
Consider the following Boolean expression where a and b are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1027

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int p = 5; int q = 2; int sum = 0; while (p <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1028

Multiple choice Unit 2: Selection and Iteration
Consider the following method: public static void conditionTest(int num1, int num2) { if ((num1 > 0) && (num2 > 0)) { if (num1 > num2) System.out.println("A");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1029

Multiple choice Unit 2: Selection and Iteration
Consider the following two code blocks where count and n are both integer values: // Code block I for (count = 0; count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1030

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int a = 8, b = 3, temp = 0; for (int i = 1; i < 6; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,021 of 3,140
Page 103 of 314