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 331–340 of 3,140
  1. 331
  2. 332
  3. 333
  4. 334
  5. 335
  6. 336
  7. 337
  8. 338
  9. 339
  10. 340

Question 331

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public double goFigure(int n) { n %= 7; return (double) (12 / n); } What is printed…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 332

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public int locate(String str, String oneLetter) { int j = 0; while (j < str.length() &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 333

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String a = "A"; String b = a;// Line 1 String c = a + 1;// Line 2 String d = b +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 334

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public int randomPoints(int n) { return (int) (n * Math.random()) + 1; } Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 335

Multiple choice Unit 1: Using Objects and Methods
Given the declarations: int p = 5; int q = 3; Which of the following expressions evaluate…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 336

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String band = "anamanaguchi";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 337

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: if (!somethingIsFalse()) return false; else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 338

Multiple choice Unit 1: Using Objects and Methods
Consider the following statement: System.out.println(Math.pow(2,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 339

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: Integer n = 3; // Line 1 Double x = 0.14; // Line 2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 340

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; < missing statement > System.out.println(abc.substring(k, k+1)); It is intended…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 331 of 3,140
Page 34 of 314