Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 121–130 of 2,811
  1. 121
  2. 122
  3. 123
  4. 124
  5. 125
  6. 126
  7. 127
  8. 128
  9. 129
  10. 130

Question 121

Multiple choice Unit 1: Using Objects and Methods
What is the general formula for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 122

Multiple choice Unit 1: Using Objects and Methods
Write a method that loops until the user inputs the correct secret password or until the user fails to enter the correct password 10 times. The secret password…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 123

Multiple choice Unit 1: Using Objects and Methods
What would the method call myMethod("Karel The Dog", 'e') return? public int myMethod(String x,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 124

Multiple choice Unit 1: Using Objects and Methods
What kind of error would the method call myMethod("frog") cause? public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 125

Multiple choice Unit 1: Using Objects and Methods
What does the call to the method someMethod(3,1) output? public int someMethod(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 126

Multiple choice Unit 1: Using Objects and Methods
What will the call to method patternGrid(3,4,'#') print? public void patternGrid(int rows, int columns, char symbol) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 127

Multiple choice Unit 1: Using Objects and Methods
What would the call to method divideByTen(340) output? public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 128

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public static String mystery(String word, int index) { String result = ""; for (int i = word.length() - 1;i >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 129

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String word = "Cafeteria"; for(/* missing condition */) { System.out.print(word.substring(i+1,i+2) + " "); } The code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 130

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public int countPs(String word) { int sum = 0; for (int i = 0;i < word.length();i++) { word = word.toLowerCase(); if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 121 of 2,811
Page 13 of 282