Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Practice Questions

Work through AP Computer Science A practice 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 151–160 of 740
  1. 151
  2. 152
  3. 153
  4. 154
  5. 155
  6. 156
  7. 157
  8. 158
  9. 159
  10. 160

Question 151

Multiple choice Boolean Expressions
Consider the following code segment. Assume that x and y are properly declared and initialized integer variables. int z = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 152

Multiple choice Iteration
Consider the following code segment. int n = 0; while (n < 10) { n += 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 153

Multiple choice Boolean Expressions
Consider the following code segment. Assume that value is a properly declared and initialized integer variable. if (value < 7) { value + = value;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 154

Multiple choice Iteration
Consider the following code segment. for (int j = 0;j <= 3;j++) { for (int k = 0;k < 3;k++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 155

Multiple choice Boolean Expressions
Assume that x and y are boolean variables and have been properly initialized. (x && y) ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 156

Multiple choice Iteration
Consider the following code segment. int t = 0; for (int v = 1;v < 20;/ * missing increment * / ) { t = t + v; } Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 157

Multiple choice Iteration
Consider the following code segment. int x = 102; int y = 5; int c = 0; while (x - y >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 158

Multiple choice Boolean Expressions
Which of the following Java expressions evaluates to true if the int variable…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 159

Multiple choice Iteration
Consider the following code segment. for (int j = 0;j < 4;j++) { for ( / * missing code * / ) { System.out.print("(" + j + "," + k + ") "); }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 160

Multiple choice Boolean Expressions
Consider the following code segment. if (n != 0 && x / n > 100) statement1; else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 151 of 740
Page 16 of 74