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 141–150 of 546
  1. 141
  2. 142
  3. 143
  4. 144
  5. 145
  6. 146
  7. 147
  8. 148
  9. 149
  10. 150

Question 141

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 142

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 143

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 144

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 145

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 146

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 147

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 148

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 149

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 150

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 141 of 546
Page 15 of 55