Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 931–940 of 1,079
  1. 931
  2. 932
  3. 933
  4. 934
  5. 935
  6. 936
  7. 937
  8. 938
  9. 939
  10. 940

Question 931

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 932

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 933

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 934

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 935

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

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

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

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

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

Multiple choice Using Text Files
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 931 of 1,079
Page 94 of 108