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.

Questions 61–70 of 692
  1. 61
  2. 62
  3. 63
  4. 64
  5. 65
  6. 66
  7. 67
  8. 68
  9. 69
  10. 70

Question 61

Multiple choice Iteration
What will the call to the method funWithNumbers(314159) print to the screen? public void funWithNumbers(double myDouble) { int myInt =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 62

Multiple choice Iteration
Consider the following code segment: int x = 10; int y = 2; int count = 1; while(x > y)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 63

Multiple choice Iteration
Consider the following code segment: int p = 5; while(p > 0) { for(int j = p; j < p*2; j++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 64

Multiple choice Iteration
Consider the following code segment: int counter = 5; int sum = 0; while(counter < 10) { sum+= counter; counter+=2; } Which of the following for loops would…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 65

Multiple choice Iteration
How many times will the word "Heyo!" be printed in the following code segment? int count =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 66

Multiple choice Iteration
Consider the following code segment: int num = 8; for(int i = num; i > 0; i -= 3) //Line 2 {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 67

Multiple choice Iteration
Consider the following code segment: for(int j = 0; j < 4; j++) //Line 1 { for(int k = 0; k < j+1; k++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 68

Multiple choice Iteration
Consider the following code segment: int b = 10; String result = ""; while(b < 100) { result += b; b *=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 69

Multiple choice Boolean Expressions
Which of the following is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 70

Multiple choice Boolean Expressions
What does this Java…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 61 of 692
Page 7 of 70