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,941–2,950 of 3,140
  1. 2941
  2. 2942
  3. 2943
  4. 2944
  5. 2945
  6. 2946
  7. 2947
  8. 2948
  9. 2949
  10. 2950

Question 2941

Multiple choice Unit 4: Data Collections
A text file contains: cat dog bird fish. What is printed? int count = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2942

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2943

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2944

Multiple choice Unit 4: Data Collections
A text file contains: 3 8 5 12 7 4. What is printed? int count = 0; while (sc.hasNext()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2945

Multiple choice Unit 4: Data Collections
A text file contains: 3 7 2 9 5. What is printed? int sum = 0; while (sc.hasNext()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2946

Multiple choice Unit 4: Data Collections
A text file contains: 4 9 2 7 1. What is printed? int max = sc.nextInt(); while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2947

Multiple choice Unit 4: Data Collections
A text file contains: 6 3 8 1 5. What is printed? int min = sc.nextInt(); while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2948

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2949

Multiple choice Unit 4: Data Collections
A text file contains: cat bat hat dog mat. What is printed? int count = 0; while (sc.hasNext()) { String s =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2950

Multiple choice Unit 4: Data Collections
A text file contains: 10 20 30. 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 2,941 of 3,140
Page 295 of 314