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.

Questions 1,021–1,030 of 1,222
  1. 1021
  2. 1022
  3. 1023
  4. 1024
  5. 1025
  6. 1026
  7. 1027
  8. 1028
  9. 1029
  10. 1030

Question 1021

Multiple choice Using Text Files
A text file contains: false 10. What is printed? boolean b = sc.nextBoolean(); int x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1022

Multiple choice Using Text Files
A text file contains: 10 20 30. What is printed? int sum = 0; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1023

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

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

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 1026

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 1027

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 1028

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 1029

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 1030

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 1,021 of 1,222
Page 103 of 123