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

Question 161

Multiple choice Using Objects
Which print statement will produce the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 162

Multiple choice Using Objects
Consider the following code segment. int rand = (int)(Math.random() * 5 + 3); rand =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 163

Multiple choice Using Objects
Consider the following code segment. int val1 = 10; int val2 = 7; val1 = (val1 + val2) % (val1 - val2); val2 = 3 + val1 * val2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 164

Multiple choice Using Objects
Assume double dnum has been correctly declared and initialized with a valid value.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 165

Multiple choice Using Objects
Which of these expressions correctly computes the positive root of a quadratic equation assuming coefficients a, b, c have…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 166

Multiple choice Using Objects
The following shuffling method is used to shuffle an array arr of int values. The method assumes the existence of a swap method, where swap(arr,i,j)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 167

Multiple choice Using Objects
Consider method getCount below. public static int getCount(String s, String sub) { int count = 0; int pos = s.indexOf(sub); while (pos >= 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 168

Multiple choice Using Objects
This question is based on the following declarations. String strA = "CARROT", strB = "Carrot", strC = "car";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 169

Multiple choice Using Objects
A programmer has a file of names. She is designing a program that sends junk mail letters to everyone on the list. To make the letters sound personal and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 170

Multiple choice Using Objects
Refer to the nextIntInRange method below. /** Returns a random integer in the range low to high, inclusive. */ public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 454
Page 17 of 46