Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, 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: Arrays Clear filter

Questions 271–280 of 341
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Multiple choice Arrays
What is count after the loop? int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Arrays
What are the final array and sum? int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Arrays
For a nonempty array, what does this method return? public int mystery(int[] a){ int m=-1,index=0; for(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Multiple choice Arrays
What is printed? int[] arr={1,2,3,4,5};int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Arrays
What is printed? int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Arrays
Given the array int[] arr = {5, 10, 15, 20,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Arrays
Consider the following method, which is intended to return the maximum integer value contained in ranges. /** Precondition: ranges contains at least one…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Arrays
private int n; public boolean check(int[ ] arr) { boolean theCheck = true; for (int k = 0; k < n - 1; k++) { if (arr[k] >= arr[k+1]) theCheck =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Arrays
private int n; public boolean check(int[ ] arr) { boolean theCheck = true; for (int k = 0; k < n - 1; k++) { if (arr[k] >= arr[k+1]) theCheck =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Arrays
Consider the following incomplete method that is intended to determine if the corresponding elements of two parallel arrays are equal. // precondition:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 341
Page 28 of 35