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,041–1,050 of 3,140
  1. 1041
  2. 1042
  3. 1043
  4. 1044
  5. 1045
  6. 1046
  7. 1047
  8. 1048
  9. 1049
  10. 1050

Question 1041

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int val1 = 2, val2 = 22, val3 = 78; while (val2 % val1 == 0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1042

Multiple choice Unit 2: Selection and Iteration
What will be the output when the following code is evaluated? for (int k = 0; k < 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1043

Multiple choice Unit 2: Selection and Iteration
Consider the following code fragments. Assume someNum has been correctly defined and initialized as a positive integer. I. int i; for (i = 0; i < someNum; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1044

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: for (int i = 1; i < 100; i = i * 2) { if (i / 50 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1045

Multiple choice Unit 2: Selection and Iteration
Consider the following output: 0 1 0 2 4 0 3 6 9 0 4 8 12 16…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1046

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = 10; int y = 3; boolean b = true; for (int i = 0; i < 15; i += 5) { x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1047

Multiple choice Unit 2: Selection and Iteration
In the following statement, a and b are boolean variables: boolean c =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1048

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: while ((x > y) || y >= z) { //code not shown } In the code segment above,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1049

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = 10; int y = x / 3; int z = x % 2; x++;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1050

Multiple choice Unit 2: Selection and Iteration
Consider the following code segments: I. int x = 10; int y = 20; int z = 0; if (x < y && 10 < y/z) { System.out.println("Homer"); } else {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,041 of 3,140
Page 105 of 314