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 201–210 of 3,140
  1. 201
  2. 202
  3. 203
  4. 204
  5. 205
  6. 206
  7. 207
  8. 208
  9. 209
  10. 210

Question 201

Free response Unit 1: Using Objects and Methods
Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and right are gone. So "ab*cd"…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 202

Free response Unit 1: Using Objects and Methods
Given a string and a non-empty word string, return a version of the original String where all chars have been replaced by pluses ("+"), except for appearances…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 203

Free response Unit 1: Using Objects and Methods
Given a string and a non-empty word string, return a string made of each char just before and just after every appearance of the word in the string. Ignore…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 204

Free response Unit 1: Using Objects and Methods
Given a string, count the number of words ending in 'y' or 'z' -- so the 'y' in "heavy" and the 'z' in "fez" count, but not the 'y' in "yellow" (not case…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 205

Free response Unit 1: Using Objects and Methods
Given two strings, base and remove, return a version of the base string where all instances of the remove string have been removed (not case sensitive). You may…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 206

Free response Unit 1: Using Objects and Methods
Given a string, return true if the number of appearances of "is" anywhere in the string is equal to the number of appearances of "not" anywhere in the string…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 207

Free response Unit 1: Using Objects and Methods
We'll say that a lowercase 'g' in a string is "happy" if there is another 'g' immediately to its left or right. Return true if all the g's in the given string…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 208

Free response Unit 1: Using Objects and Methods
We'll say that a "triple" in a string is a char appearing three times in a row. Return the number of triples in the given string. The triples may…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 209

Free response Unit 1: Using Objects and Methods
Given a string, return the longest substring that appears at both the beginning and end of the string without overlapping. For example,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 210

Free response Unit 1: Using Objects and Methods
Given a string, look for a mirror image (backwards) string at both the beginning and end of the given string. In other words, zero or more characters at the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 201 of 3,140
Page 21 of 314