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 1,051–1,060 of 3,140
  1. 1051
  2. 1052
  3. 1053
  4. 1054
  5. 1055
  6. 1056
  7. 1057
  8. 1058
  9. 1059
  10. 1060

Question 1051

Multiple choice Unit 2: Selection and Iteration
Given int x = 7 and int y = 3, what is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1052

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int sum = 0; for (int i = 1; i <= 5; i++) { if (i % 2 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1053

Multiple choice Unit 2: Selection and Iteration
Consider the following boolean expression: !(x > 5 && y < 10) ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1054

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = 5; int y = 10; boolean result = (x > 7) && (y++ <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1055

Multiple choice Unit 2: Selection and Iteration
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 1056

Multiple choice Unit 2: Selection and 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 1057

Multiple choice Unit 2: Selection and 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 1058

Free response Unit 2: Selection and Iteration
This question involves dog walkers who are paid through a dog-walking company to take dogs for one-hour walks. A dog-walking company has a varying number of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1059

Multiple choice Unit 2: Selection and 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 1060

Multiple choice Unit 2: Selection and 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 1,051 of 3,140
Page 106 of 314