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 131–140 of 3,140
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: Consider the following method: public static void mix(String word, String letter) { int counter = 0; while(word.indexOf(letter) >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice Unit 1: Using Objects and Methods
Consider the following incomplete code segment, which is intended to increase the value of each digit in a String by one. For example, if num is 12345, then the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice Unit 1: Using Objects and Methods
What will be returned from this method if grades(80) was called? public String grades(int grade) { String letterGrade = ""; if (grade >= 90) { letterGrade + =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Multiple choice Unit 1: Using Objects and Methods
What is the output of this code? String firstName = "Karel"; String lastName = "The Dog"; if (firstName.length() > lastName.length()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 135

Multiple choice Unit 1: Using Objects and Methods
Given the following Circle class public class Circle { private int radius; public Circle(int theRadius) { radius = theRadius; } public void setRadius(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice Unit 1: Using Objects and Methods
Given the following Circle class public class Circle { private int radius; public Circle(int theRadius) { radius = theRadius; } public void setRadius(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

Multiple choice Unit 1: Using Objects and Methods
Which of the following Boolean expressions will yield true after the code snippet executes?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 138

Multiple choice Unit 1: Using Objects and Methods
What will this code return given checkMethod(false, true)? public int checkMethod(boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 139

Multiple choice Unit 1: Using Objects and Methods
What will this method call output given yesOrNo(true)? public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 140

Multiple choice Unit 1: Using Objects and Methods
Given the following call, what value would be returned for findTheMiddle(2110890125)? public static String findTheMiddle(int number) { String stringNum = "" +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 131 of 3,140
Page 14 of 314