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 321–330 of 2,811
  1. 321
  2. 322
  3. 323
  4. 324
  5. 325
  6. 326
  7. 327
  8. 328
  9. 329
  10. 330

Question 321

Multiple choice Unit 1: Using Objects and Methods
What is the value of result after the following code executes?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 322

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. double q = 15.0; int r = 2; double x = (int) (q / r); double y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 323

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int x = ((int) (Math.random() * 10)) + 5; int y = ((int) (Math.random() * 5)) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 324

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String str1 = "LMNOP"; String str2 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 325

Multiple choice Unit 1: Using Objects and Methods
Assume that x, y, and z are boolean variables that have been properly declared…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 326

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public static int mystery(int n){ int a, b, c = 0; while (n > 0){ a = n/10; b = n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 327

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int x = 2; int y = 4; x += y; y += x;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 328

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. // precondition : n > 1 public static double solve(int n) { double answer = 1.0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 329

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public boolean evaluate(boolean p,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 330

Multiple choice Unit 1: Using Objects and Methods
Consider the following method, which is intended to count the number of times a value is doubled before it is at least as large as a target value. //…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 321 of 2,811
Page 33 of 282