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,081–1,090 of 3,140
  1. 1081
  2. 1082
  3. 1083
  4. 1084
  5. 1085
  6. 1086
  7. 1087
  8. 1088
  9. 1089
  10. 1090

Question 1081

Multiple choice Unit 2: Selection and Iteration
What is printed when the following code executes? int n = 256; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1082

Multiple choice Unit 2: Selection and Iteration
What is the value of result after the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1083

Multiple choice Unit 2: Selection and Iteration
What is printed by the following code? int x = 1; while (x < 30)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1084

Multiple choice Unit 2: Selection and Iteration
What is the value of sum? int sum = 0; for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1085

Multiple choice Unit 2: Selection and Iteration
What is printed? String s = "mississippi"; int count = 0; for (int i = 0; i < s.length() - 1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1086

Multiple choice Unit 2: Selection and Iteration
Consider the following method. What does mystery(18) return? public static int mystery(int n) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1087

Multiple choice Unit 2: Selection and Iteration
Which of the following boolean expressions is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1088

Multiple choice Unit 2: Selection and Iteration
What is printed? int x = 15, y = 20, z = 10; String result = ""; if (x > z && y > x) { if (y - x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1089

Multiple choice Unit 2: Selection and Iteration
This method computes the digit sum of a positive integer. What does it print when n = 156?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1090

Multiple choice Unit 2: Selection and Iteration
What is printed? int total = 0; for (int i = 1; i <= 50; i++) { if (i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,081 of 3,140
Page 109 of 314