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 541–550 of 3,140
  1. 541
  2. 542
  3. 543
  4. 544
  5. 545
  6. 546
  7. 547
  8. 548
  9. 549
  10. 550

Question 541

Multiple choice Unit 1: Using Objects and Methods
What is printed by the following code segment? String s…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 542

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment.
String s = "computer";
String t = s.substring(0, s.indexOf("u")) + s.substring(5);
What value is stored in t ?
Pick an answer, then check it. The solution opens in a window.

Question 543

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. double y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 544

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String s = "campus"; String t =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 545

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment.
int p = 17 % 5;
double q = 17 / 5;
double r = q + p / 2.0;
What value is stored in r ?
Pick an answer, then check it. The solution opens in a window.

Question 546

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment.
int a = 11;
int b = 4;
double value = a / b + (a % b) / 2.0;
What value is stored in value after the code segment executes?
Pick an answer, then check it. The solution opens in a window.

Question 547

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String word = "algorithm"; String part =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 548

Multiple choice Unit 1: Using Objects and Methods
Consider the following declarations. String s1 = "grid"; String s2 = "grip"; boolean same = s1.equals(s2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 549

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. Integer m = new Integer(6); Double n = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 550

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String word = "practice"; String result =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 541 of 3,140
Page 55 of 314