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 211–220 of 2,811
  1. 211
  2. 212
  3. 213
  4. 214
  5. 215
  6. 216
  7. 217
  8. 218
  9. 219
  10. 220

Question 211

Multiple choice Unit 1: Using Objects and Methods
Consider the program segment. for (int i = start;i <= stop;i++) System.out.println("AP…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 212

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int num = (int)(Math.random() * 30 + 20); num += 5; num =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 213

Multiple choice Unit 1: Using Objects and Methods
Consider the following method that is intended to remove all Strings from words that are less than six letters long. public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 214

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int varA = - 30; int varB = 30; while (varA != 0 || varB > 0) { varA = varA + 2; varB =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 215

Multiple choice Unit 1: Using Objects and Methods
The following incomplete code is intended to count the number of times the letter key is found in phrase. public static int countOccurrences (String phrase,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 216

Multiple choice Unit 1: Using Objects and Methods
Assume str1 and str2 are correctly initialized String variables. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 217

Multiple choice Unit 1: Using Objects and Methods
Assume names is a String array. Which statement…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 218

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public int countLetters(String word, String letter) { int count = 0; for (int index = 0;index < word.length();index++) { if ( /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 219

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String newString = "Welcome"; String anotherString = "Home"; newString =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 220

Multiple choice Unit 1: Using Objects and Methods
What is printed as a result of executing the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 211 of 2,811
Page 22 of 282