Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 31–40 of 454
  1. 31
  2. 32
  3. 33
  4. 34
  5. 35
  6. 36
  7. 37
  8. 38
  9. 39
  10. 40

Question 31

Multiple choice Using Objects
Consider the following method that is intended to determine if the double values d1 and d2 are close enough to be considered equal. For example, given a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 32

Multiple choice Using Objects
Consider the following instance variable and methods. You may assume that data has been initialized with length > 0. The methods are intended to return the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 33

Multiple choice Using Objects
Consider the following method. public String mystery(String input) { String output = ""; for (int k = 1;k < input.length();k =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 34

Multiple choice Using Objects
Assume that myList is an ArrayList that has been correctly constructed and populated…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 35

Multiple choice Using Objects
Consider the following method. public static String scramble(String word, int howFar) { return word.substring(howFar +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 36

Multiple choice Using Objects
Consider the following method. public int compute(int n, int k) { int answer = 1; for (int i = 1;i <= k;i++) answer…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 37

Multiple choice Using Objects
Consider the following method. public void test(int x) { int y; if (x % 2 == 0) y = 3; else if (x > 9) y = 5; else y =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 38

Multiple choice Using Objects
Assume that String variables str1 and str2 have been properly declared and initialized. Which of the following boolean expressions…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 39

Multiple choice Using Objects
Which of the following methods are equivalent (always return the same value for the same values of input parameters)? I. public boolean fun(int a, int b, int c)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 40

Multiple choice Using Objects
Consider the following code segment. int n = IO.readInt(); // read an int value n = Math.abs(n); while (n >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 31 of 454
Page 4 of 46