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.

Subtopic: Using Text Files Clear filter

Questions 101–110 of 181
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Using Text Files
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 102

Multiple choice Using Text Files
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 103

Multiple choice Using Text Files
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 104

Multiple choice Using Text Files
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 105

Multiple choice Using Text Files
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 106

Multiple choice Using Text Files
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 107

Multiple choice Using Text Files
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 108

Multiple choice Using Text Files
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 109

Multiple choice Using Text Files
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 110

Multiple choice Using Text Files
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 101 of 181
Page 11 of 19