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

Question 201

Multiple choice Using Objects
Consider the following method. public int mystery(String code, int index) { if (code.indexOf("c") == index) { return index; } return mystery(code.substring(2),…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 202

Multiple choice Using Objects
Consider the following statement. int number = (int)(Math.random() * 21 + 13);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 203

Multiple choice Using Objects
Consider the following code segment. String myString = "H"; int index = 0; while (index < 4) { for (int i = 0;i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 204

Multiple choice Using Objects
Consider the following statement. int var = (int)(Math.random() * 50) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 205

Multiple choice Using Objects
Consider the following method. public boolean whatDoesItDo(String st) { for (int i = 0;i < st.length() / 2;i++) { String sub1 = st.substring(i, i + 1); String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 206

Multiple choice Using Objects
Consider the following method. public String mixItUp(String entry1, String entry2) { entry2 = entry1; entry1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 207

Multiple choice Using Objects
Consider the following method. The method is intended to return true if the value val raised to the power power is within the tolerance tolerance of the target…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 208

Multiple choice Using Objects
Consider the following method. public int firstLetterIndex(String s2) { String s1 = "abcdefghijklmnopqrstuvwxyz"; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 209

Free response Using Objects
A Password class contains methods used to determine information about passwords. You will write two methods of the class. public class Password { private String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 210

Multiple choice Using Objects
Given the String declaration String course = "AP Computer…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 201 of 546
Page 21 of 55