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 281–290 of 3,140
  1. 281
  2. 282
  3. 283
  4. 284
  5. 285
  6. 286
  7. 287
  8. 288
  9. 289
  10. 290

Question 281

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 282

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 283

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 284

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 285

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 286

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 287

Free response Unit 1: Using Objects and Methods
In the seventeenth century, Location Numerals were invented as a new way to represent numbers. Location Numerals have a lot in common with the binary number…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 288

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 289

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 290

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String str1 = "presto chango"; String str2 = "abracadabra"; int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 281 of 3,140
Page 29 of 314