Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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 2,011–2,020 of 3,140
  1. 2011
  2. 2012
  3. 2013
  4. 2014
  5. 2015
  6. 2016
  7. 2017
  8. 2018
  9. 2019
  10. 2020

Question 2011

Multiple choice Unit 4: Data Collections
Given the following values of arr and the mystery method, what will the values of arr be after you execute: mystery()? private…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2012

Multiple choice Unit 4: Data Collections
The following codes are intended to add 5 to each item in the array. I. int[] numbers = {1, 2, 3, 4}; for (int i = 0;i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2013

Multiple choice Unit 4: Data Collections
What does the following code do when executed? int[] highTemp = {88, 92, 94, 90, 88, 83}; int target = 90;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2014

Multiple choice Unit 4: Data Collections
The method should detect equal adjacent elements. Which changes are needed? I: initialize…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2015

Multiple choice Unit 4: Data Collections
What will print out when the following code executes? int[] nums = {1, 2, 3, 4, 5, 6}; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2016

Multiple choice Unit 4: Data Collections
What does the following code snippet output? int[] numbers = {1, 2, 3, 4, 5}; int[] temp = new int[numbers.length]; for (int i = 0;i < numbers.length - 1;i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2017

Multiple choice Unit 4: Data Collections
What does the following code snippet check for? int[] numbers = {1, 2, 3, 3, 4, 5}; boolean mysteryBoolean = false; for (int i = 0;i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2018

Multiple choice Unit 4: Data Collections
What does the following code snippet do? int[] scores = {80, 92, 91, 68, 88}; int sum = 0; for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2019

Multiple choice Unit 4: Data Collections
What is the output after this code snippet runs? int[] scores = {80, 92, 91, 68, 88};…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2020

Multiple choice Unit 4: Data Collections
Which of the following code snippets gets the THIRD element in the scores array and assigns it to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,011 of 3,140
Page 202 of 314