Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice questions on Using Objects and Methods, 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 776
  1. 411
  2. 412
  3. 413
  4. 414
  5. 415
  6. 416
  7. 417
  8. 418
  9. 419
  10. 420

Question 411

Multiple choice Using Objects
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 Primitive Types
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 Using Objects
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 Primitive Types
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 Using Objects
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 Primitive Types
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 Using Objects
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 Using Objects
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 Primitive Types
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 Using Objects
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 776
Page 42 of 78