Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 271–280 of 2,811
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Multiple choice Unit 1: Using Objects and Methods
Suppose a, b, and c are positive integers under 1000, and x satisfies the formula \[ \frac{a}{b} = \frac{c}{x} \] The integer value d is obtained by truncating…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: int x = (int)Math.pow(2, 5);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String str = "012345"; for (int i = 0; i < str.length() - 1; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Multiple choice Unit 1: Using Objects and Methods
What is the output from the following code? String s = "Computer Science is fun!"; String s1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public static int mystery(int y) { y = 2 * y + y; y = 2 * y + y; return y; } Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Unit 1: Using Objects and Methods
Given the following code segment: String s1 = new String("hi"); String s2 = new String("hi"); String s3 = s2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String s1 = "Hi There"; String s2 = s1; String s3 = s2; String s4 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Unit 1: Using Objects and Methods
Given the following code segment: String s = "Computer Science is fun!"; String s1 = s.substring(0,8); String s2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String s1 = new String("hi"); String s2 = new String("hi there"); String s3 = s2.substring(0, 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: public static void test(String str, int y) { str = str + "bow"; y = y *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 2,811
Page 28 of 282