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,431–2,440 of 3,140
  1. 2431
  2. 2432
  3. 2433
  4. 2434
  5. 2435
  6. 2436
  7. 2437
  8. 2438
  9. 2439
  10. 2440

Question 2431

Free response Unit 4: Data Collections
Consider a system for processing names and addresses from a mailing list. A Recipients class will be used as part of this system. The lines in the mailing list…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2432

Free response Unit 4: Data Collections
A puzzle-solving competition is held in a large hall with a two-dimensional arrangement of contestants. Each rectangle below represents one contestant. A…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2433

Multiple choice Unit 4: Data Collections
Consider the following instance variables and method assignValues in the same class. private int numRows; private int numCols; private int[][] mat; /** arr has…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2434

Multiple choice Unit 4: Data Collections
Let list be an ArrayList<String> containing only these elements. "John", "Mary", "Harry", "Luis" Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2435

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] nums; /** Precondition: nums contains int values in no particular order. */ public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2436

Multiple choice Unit 4: Data Collections
Consider the following method. public int mystery(int n) { if (n == 0) return 0; else if (n % 2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2437

Multiple choice Unit 4: Data Collections
A two-dimensional matrix mat with at least one row is initialized and will be traversed using…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2438

Multiple choice Unit 4: Data Collections
A class of 30 students rated their computer science teacher on a scale of 1 to 10 (1 means awful and 10 means outstanding). The responses array is a 30-element…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2439

Multiple choice Unit 4: Data Collections
Consider an array arr that is initialized with int values. The following code segment stores in count the number of positive values in arr. int count = 0, index…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2440

Multiple choice Unit 4: Data Collections
A square matrix is declared as int[][] mat = new int[SIZE][SIZE]; where SIZE is an appropriate integer constant. Consider the following method. public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,431 of 3,140
Page 244 of 314