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.

Questions 191–200 of 776
  1. 191
  2. 192
  3. 193
  4. 194
  5. 195
  6. 196
  7. 197
  8. 198
  9. 199
  10. 200

Question 191

Free response Using Objects
Given two strings, a and b, create a bigger string made of the first char of a, the first char of b, the second char of a, the second char of b, and so on. Any…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 192

Free response Using Objects
Given a string and an int n, return a string made of n repetitions of the last n characters of the string. You may assume that n is between 0 and the length of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 193

Free response Using Objects
Given a string and an int n, return a string made of the first n characters of the string, followed by the first n-1 characters of the string, and so on. You…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 194

Free response Using Objects
Given two strings, word and a separator sep, return a big string made of count occurrences of the word, separated by the separator string.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 195

Free response Using Objects
Given a string, consider the prefix string made of the first N chars of the string. Does that prefix string appear somewhere else in the string? Assume that the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 196

Free response Using Objects
Given a string, does "xyz" appear in the middle of the string? To define middle, we'll say that the number of chars to the left and right of the "xyz" must…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 197

Free response Using Objects
A sandwich is two pieces of bread with something in between. Return the string that is between the first and last appearance of "bread" in the given string, or…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 198

Free response Using Objects
Returns true if for every '*' (star) in the string, if there are chars both immediately before and after the star, they are the same.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 199

Free response Using Objects
Given a string, compute a new string by moving the first char to come after the next two chars, so "abc" yields "bca". Repeat this process for each subsequent…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 200

Free response Using Objects
Look for patterns like "zip" and "zap" in the string -- length-3, starting with 'z' and ending with 'p'. Return a string where for all such words, the middle…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 191 of 776
Page 20 of 78