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 401–410 of 3,140
  1. 401
  2. 402
  3. 403
  4. 404
  5. 405
  6. 406
  7. 407
  8. 408
  9. 409
  10. 410

Question 401

Multiple choice Unit 1: Using Objects and Methods
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 402

Multiple choice Unit 1: Using Objects and Methods
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 403

Multiple choice Unit 1: Using Objects and Methods
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 404

Multiple choice Unit 1: Using Objects and Methods
What is the data type of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 405

Multiple choice Unit 1: Using Objects and Methods
What is the value of result after the following code executes?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 406

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. double q = 15.0; int r = 2; double x = (int) (q / r); double y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 407

Multiple choice Unit 1: Using Objects and Methods
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 408

Multiple choice Unit 1: Using Objects and Methods
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 409

Multiple choice Unit 1: Using Objects and Methods
Assume that x, y, and z are boolean variables that have been properly declared…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 410

Free response Unit 1: Using Objects and Methods
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 401 of 3,140
Page 41 of 314