Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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,001–1,010 of 2,811
  1. 1001
  2. 1002
  3. 1003
  4. 1004
  5. 1005
  6. 1006
  7. 1007
  8. 1008
  9. 1009
  10. 1010

Question 1001

Multiple choice Unit 2: Selection and Iteration
public static int mystery(int value) { int result = 0; while (value > 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1002

Multiple choice Unit 2: Selection and Iteration
public static int countDown(int start) { int count = 0; for (int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1003

Multiple choice Unit 2: Selection and Iteration
public static boolean isSpecial(int num) { return num…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1004

Multiple choice Unit 2: Selection and Iteration
public static int process(int limit) { int total = 0; for (int i = 1;i <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1005

Multiple choice Unit 2: Selection and Iteration
public static String buildPattern(int rows) { String result = ""; for (int i = 1;i <= rows;i++) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1006

Multiple choice Unit 2: Selection and Iteration
public static int findMax(int num1, int num2, int num3) { int max = num1; if (num2 > num1) max = num2; if (num3 >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1007

Multiple choice Unit 2: Selection and Iteration
public static int trace(int num) { int result = 0; while (num > 1) { if (num % 2 == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1008

Multiple choice Unit 2: Selection and Iteration
public static String encrypt(String word) { String result = ""; for (int i = 0;i < word.length();i++) { if (i % 2 == 0) { result + =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1009

Multiple choice Unit 2: Selection and Iteration
What is printed?
int x = 4, y = 10, z = 4;
boolean a = !(x > y) && !(z == x);
boolean b = (x < y) || (z > x);
boolean c = !(x == z || y < x);
System.out.println(a + " " + b + " " + c);
Pick an answer, then check it. The solution opens in a window.

Question 1010

Multiple choice Unit 2: Selection and Iteration
What is printed?
int n = 100;
int count = 0;
while (n > 1)
{
    n = n / 2;
    count++;
}
System.out.println(count);
Pick an answer, then check it. The solution opens in a window.
Question 1,001 of 2,811
Page 101 of 282