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,671–2,680 of 3,140
  1. 2671
  2. 2672
  3. 2673
  4. 2674
  5. 2675
  6. 2676
  7. 2677
  8. 2678
  9. 2679
  10. 2680

Question 2671

Free response Unit 4: Data Collections
This question involves manipulation of one-dimensional and two-dimensional arrays. In part (a), you will write a method to shift the elements of a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2672

Multiple choice Unit 4: Data Collections
ArrayList<String> list = new ArrayList<String>(); list.add("A"); list.add("B"); list.add("C"); for (String s : list) { String t =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2673

Multiple choice Unit 4: Data Collections
public class FrequentFlyer { private int miles = 0; public FrequentFlyer(int m) { miles = m; } public void addMiles(int m) { miles += m;} public int getMiles()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2674

Free response Unit 4: Data Collections
GapInserter receives a strictly increasing ArrayList . Whenever two ORIGINAL consecutive values differ by exactly2, add the missing integer between them. Larger…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2675

Free response Unit 4: Data Collections
UniqueWordAnalyzer processes nonempty lowercase comments. Words are separated by single spaces; each comment contains at least one word. public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2676

Multiple choice Unit 4: Data Collections
Meetings use half-open intervals[start,end), so touching endpoints do not conflict. For meetings[2,4),[4,6),[3,5), what pair is returned by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2677

Free response Unit 4: Data Collections
Highway is a rectangular nonempty int matrix: rows are lanes, columns are positions. A1 is a car and a0 an empty position. Cars move right; forward movement…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2678

Free response Unit 4: Data Collections
Seats in a movie theater are modeled by a two-dimensional array of boolean values: true represents an occupied seat and false represents a vacant seat. Row…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2679

Free response Unit 4: Data Collections
Book objects are ordered alphabetically by title, then by publication year. Each input shelf is sorted and individually duplicate-free. A book with the same…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2680

Free response Unit 4: Data Collections
In chess, a queen can move vertically, horizontally, and diagonally on an 8-by-8 chessboard. The picture below shows all the positions on the board that a queen…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,671 of 3,140
Page 268 of 314