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 411–420 of 3,140
  1. 411
  2. 412
  3. 413
  4. 414
  5. 415
  6. 416
  7. 417
  8. 418
  9. 419
  10. 420

Question 411

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 412

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 413

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 414

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 415

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 416

Multiple choice Unit 1: Using Objects and Methods
Assuming that b is a boolean variable, what will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 417

Multiple choice Unit 1: Using Objects and Methods
Which expression below is equivalent to the following?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 418

Free response Unit 1: Using Objects and Methods
The StringRotation class contains methods used to determine if a string is a rotation of another string. The declaration of the StringRotation class is shown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 419

Multiple choice Unit 1: Using Objects and Methods
What is the value of x after the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 420

Multiple choice Unit 1: Using Objects and Methods
What is the output of the following code? String word = "blueprint"; String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 411 of 3,140
Page 42 of 314