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 311–320 of 546
  1. 311
  2. 312
  3. 313
  4. 314
  5. 315
  6. 316
  7. 317
  8. 318
  9. 319
  10. 320

Question 311

Multiple choice Using Objects
Consider the following Java code: public class StringManipulator { public static void main(String[] args) { String text = "Computer…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 312

Multiple choice Using Objects
What is the output of the following code segment? String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 313

Multiple choice Using Objects
Consider the following code segment: String str = "Computer Science"; String sub =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 314

Multiple choice Using Objects
Which of the following code segments correctly creates an…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 315

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

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

Free response Using Objects
This question involves the `MessageBuilder` class, which is used to generate a message based on a starting word. The `MessageBuilder` class contains a helper…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 318

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 319

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 320

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 311 of 546
Page 32 of 55