Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Selection and Iteration, 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: Iteration Clear filter

Questions 341–350 of 376
  1. 341
  2. 342
  3. 343
  4. 344
  5. 345
  6. 346
  7. 347
  8. 348
  9. 349
  10. 350

Question 341

Multiple choice Iteration
The code is intended to count the nonzero decimal digits of a positive int number. Which offered initial value…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 342

Multiple choice Iteration
Each version starts with int x = 0 and runs the displayed body four times. Version II changes the second if to else if. What are the final x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 343

Multiple choice Iteration
Each version starts with int result = 3. For how many int values of n from 0 through 4 inclusive do the versions finish with the same…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 344

Multiple choice Iteration
What happens when this code executes? int x = 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 345

Multiple choice Iteration
Each version begins with int x = 2 and int y = 1. For every int n from 0 through 8 inclusive, which replacement body preserves both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 346

Multiple choice Iteration
For every int n from 0 through 6 inclusive, which statement in the replacement loop preserves the final total? Each version starts with total = 0. // Original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 347

Multiple choice Iteration
What is printed as a result of executing the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 348

Multiple choice Iteration
What is printed as a result of executing the following code segment? int i; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 349

Multiple choice Iteration
What is printed as a result of executing the following code segment? int count = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 350

Multiple choice Iteration
What is printed as a result of executing the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 341 of 376
Page 35 of 38