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.

Subtopic: Using Objects Clear filter

Questions 261–270 of 546
  1. 261
  2. 262
  3. 263
  4. 264
  5. 265
  6. 266
  7. 267
  8. 268
  9. 269
  10. 270

Question 261

Multiple choice Using Objects
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 262

Multiple choice Using Objects
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 263

Multiple choice Using Objects
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 264

Multiple choice Using Objects
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 265

Multiple choice Using Objects
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 266

Multiple choice Using Objects
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 267

Free response Using Objects
DNA sequencing and matching has become a standard technique in medical research, forensics, and recreational genealogy. A DNA molecule encodes genetic…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 268

Multiple choice Using Objects
Consider the following code segment: String abc = "AAABBBCCC"; String abc1 = abc.substring(0, abc.length() - 1); abc1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 269

Multiple choice Using Objects
Consider the following code segment: int x = (int)Math.pow(2, 5);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 270

Free response Using Objects
Consider the following incomplete class definition: /** Returns a new string as described in part (a). * Precondition: All letters in text are uppercase; * 0 <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 261 of 546
Page 27 of 55