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 151–160 of 341
  1. 151
  2. 152
  3. 153
  4. 154
  5. 155
  6. 156
  7. 157
  8. 158
  9. 159
  10. 160

Question 151

Multiple choice Arrays
A bingo game needs one BingoCard reference for each of NUMPLAYERS players. Which declares the array? public class BingoCard…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 152

Multiple choice Arrays
players has been allocated as a BingoCard array but its entries are null. Which constructs and stores each card? public class BingoCard { private int[] card…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 153

Free response Arrays
The PR2004 is a robot that automatically gathers toys and other items scattered in a tiled hallway. A tiled hallway has a wall at each end and consists of a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 154

Free response Arrays
This question involves reasoning about an array of integers with no duplicate values. An inversion is a pair of values in an array where a larger value appears…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 155

Free response Arrays
A statistician is studying sequences of numbers obtained by repeatedly tossing a six-sided number cube. On each side of the number cube is a single number in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 156

Free response Arrays
An electric car that runs on batteries must be periodically recharged for a certain number of hours. The battery technology in the car requires that the charge…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 157

Free response Arrays
Consider the following partial declaration for a WordScrambler class. The constructor for the WordScrambler class takes an even-length array of String objects…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 158

Free response Arrays
An array of positive integer values has the mountain property if the elements are ordered such that successive values increase until a maximum value (the peak…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 159

Free response Arrays
This question involves reasoning about one-dimensional and two-dimensional arrays of integers. You will write three static methods, all of which are in a single…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 160

Multiple choice Arrays
Consider the following code segment. int [] array = {-3, 0, 2, 4, 5, 9, 13, 1, 5}; for (int n = 1; n < array.length - 1; n++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 151 of 341
Page 16 of 35