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.

Questions 751–760 of 1,222
  1. 751
  2. 752
  3. 753
  4. 754
  5. 755
  6. 756
  7. 757
  8. 758
  9. 759
  10. 760

Question 751

Free response Arraylists
This question involves the analysis of weather data. The following WeatherData class has an instance variable, temperatures, which contains the daily high…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 752

Free response 2D Arrays
This question involves pieces of candy in a box. The Candy class represents a single piece of candy. public class Candy { / * * Returns a String representing…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 753

Free response 2D Arrays
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 754

Multiple choice Arraylists
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 755

Multiple choice 2D Arrays
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 756

Free response Arraylists
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 757

Free response Arraylists
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 758

Multiple choice Arraylists
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 759

Free response 2D Arrays
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 760

Free response 2D Arrays
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 751 of 1,222
Page 76 of 123