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,971–2,980 of 3,140
  1. 2971
  2. 2972
  3. 2973
  4. 2974
  5. 2975
  6. 2976
  7. 2977
  8. 2978
  9. 2979
  10. 2980

Question 2971

Multiple choice Unit 4: Data Collections
A text file contains: 10,20,30,40,50. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2972

Multiple choice Unit 4: Data Collections
A text file contains two lines: 1,2,3 4,5,6 What is printed? int sum = 0; while (sc.hasNext()) { String line =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2973

Multiple choice Unit 4: Data Collections
A text file contains: The quick brown fox jumps. What is printed? String line =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2974

Multiple choice Unit 4: Data Collections
A text file contains: Java:is:fun. What is printed? String line = sc.nextLine(); sc.close();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2975

Multiple choice Unit 4: Data Collections
A text file contains three lines: 10,20 30,40 50,60 What is printed? int sum = 0; while (sc.hasNext()) { String line = sc.nextLine(); String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2976

Multiple choice Unit 4: Data Collections
A text file contains: cat,dog,cat,bird,cat. What is printed? String line = sc.nextLine(); sc.close(); String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2977

Multiple choice Unit 4: Data Collections
A text file contains: 3,7. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2978

Multiple choice Unit 4: Data Collections
A text file contains: red|green|blue. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2979

Multiple choice Unit 4: Data Collections
A text file contains three lines: A,1 B,2 C,3 What is printed? int sum = 0; while (sc.hasNext()) { String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2980

Multiple choice Unit 4: Data Collections
A text file contains: start,middle,end. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,971 of 3,140
Page 298 of 314