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,951–2,960 of 3,140
  1. 2951
  2. 2952
  3. 2953
  4. 2954
  5. 2955
  6. 2956
  7. 2957
  8. 2958
  9. 2959
  10. 2960

Question 2951

Multiple choice Unit 4: Data Collections
A text file contains: 10 20 40. What is printed? int sum = 0; int count = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2952

Multiple choice Unit 4: Data Collections
A text file contains three lines: a b c d e f What is printed? int count = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2953

Multiple choice Unit 4: Data Collections
A text file contains: A B C D E. What is printed? String result = ""; int idx = 0; while (sc.hasNext()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2954

Multiple choice Unit 4: Data Collections
A text file contains: 5 1 2 3 4 5. The first number indicates how many values follow. What is printed? int n =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2955

Multiple choice Unit 4: Data Collections
A text file contains: J a v a. What is printed? String result = ""; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2956

Multiple choice Unit 4: Data Collections
A text file contains: 1.5 2.5 3.0. What is printed? double sum = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2957

Multiple choice Unit 4: Data Collections
A text file contains: 10 3 5 2. What is printed? int result = 0; int idx = 0; while (sc.hasNext()) { int n = sc.nextInt();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2958

Multiple choice Unit 4: Data Collections
A text file contains: 5 3 5 5 2 5. What is printed? int count = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2959

Multiple choice Unit 4: Data Collections
A text file contains two lines: hello world What is printed? int count = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2960

Multiple choice Unit 4: Data Collections
A text file contains: hi hello hey. What is printed? int total = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,951 of 3,140
Page 296 of 314