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 241–250 of 692
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Multiple choice Boolean Expressions
The following method is intended to return "Renaissance" for years from 1400 to 1600, inclusive, "Medieval" for years from 400 to 1399, inclusive, or "Other"…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 242

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 243

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 244

Multiple choice Iteration
A programmer has mistakenly placed a semicolon at the end of the while statement in the following code fragment. What will be the result of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 245

Multiple choice Iteration
Consider the following code segment: Line 1: int count = 0; Line 2: for (int i = 0; i < 3; i++) Line 3: { Line 4: int j = 0; Line 5: while (j <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 246

Multiple choice Iteration
How many times is "Hello" printed by the following code? for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 247

Multiple choice Iteration
Consider the following code segment. What is the final value of product? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 248

Multiple choice Iteration
A method is intended to return the largest digit in an…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 249

Multiple choice Boolean Expressions
What is printed by the following code? int x = 5; if (x > 3) { if (x > 7)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 250

Multiple choice Iteration
What is the output of this code segment? int a = 3, b = 7;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 241 of 692
Page 25 of 70