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 161–170 of 2,811
  1. 161
  2. 162
  3. 163
  4. 164
  5. 165
  6. 166
  7. 167
  8. 168
  9. 169
  10. 170

Question 161

Multiple choice Unit 1: Using Objects and Methods
Consider the following class definition. public class WordPlay { private String word; public WordPlay(String w) { word = w; } public void update(String first) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 162

Multiple choice Unit 1: Using Objects and Methods
Which of the following pairs of declarations will cause an error message? I double x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 163

Multiple choice Unit 1: Using Objects and Methods
What output will be produced by the following?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 164

Multiple choice Unit 1: Using Objects and Methods
Refer to the following code fragment. double answer = 13 / 5; System.out.println("13 / 5 = " + answer); The output is 13 / 5 = 2.0 The…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 165

Multiple choice Unit 1: Using Objects and Methods
What value is stored in result if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 166

Multiple choice Unit 1: Using Objects and Methods
Suppose that addition and subtraction had higher precedence than multiplication and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 167

Multiple choice Unit 1: Using Objects and Methods
Which is true of the following boolean expression, given…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 168

Multiple choice Unit 1: Using Objects and Methods
Let x be a variable of type double that is positive. A program contains the boolean expression (Math.pow(x,0.5) == Math.sqrt(x)). Even though \(x^{0.5}\) is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 169

Multiple choice Unit 1: Using Objects and Methods
/** Returns true if the 4-digit integer n is valid, * false otherwise. */ boolean checkNumber(int n) { int d1,d2,d3,checkDigit,nRemaining,rem; //strip off…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 170

Multiple choice Unit 1: Using Objects and Methods
/** Returns true if the 4-digit integer n is valid, * false otherwise. */ boolean checkNumber(int n) { int d1, d2, d3, checkDigit, nRemaining, rem; //strip off…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 2,811
Page 17 of 282