Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice questions on Using Objects and Methods, 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.

Subtopic: Using Objects Clear filter

Questions 151–160 of 546
  1. 151
  2. 152
  3. 153
  4. 154
  5. 155
  6. 156
  7. 157
  8. 158
  9. 159
  10. 160

Question 151

Free response Using Objects
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 152

Free response Using Objects
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 153

Free response Using Objects
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 154

Free response Using Objects
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 155

Free response Using Objects
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 156

Free response Using Objects
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 157

Free response Using Objects
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 158

Free response Using Objects
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 159

Free response Using Objects
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 160

Free response Using Objects
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 151 of 546
Page 16 of 55