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.

Subtopic: Boolean Expressions Clear filter

Questions 101–110 of 316
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Boolean Expressions
Consider the following method: public static void sample(int num1, int num2) { int result = 99; if (num1 == num2) { result = 0; } else if (num1 > num2) { result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Boolean Expressions
Consider the following method: public void sample(int num1, int num2) { int result = 99; if (num1 == num2) { result = 0; } else if (num1 > num2) { result = 1; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Boolean Expressions
Consider the following Java method, conditionTest, which takes two integer arguments, num1 and num2, and prints a letter based on their values: public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Boolean Expressions
Consider the following Boolean expression where a and b are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Boolean Expressions
Consider the following method: public static void conditionTest(int num1, int num2) { if ((num1 > 0) && (num2 > 0)) { if (num1 > num2) System.out.println("A");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Boolean Expressions
Given the Boolean expression: (x == y && !(x == y)) || (x != y && !(x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Boolean Expressions
Consider the following code segment. Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Boolean Expressions
Consider the following code. int x = 0; if (x == 0) System.out.print("1"); else System.out.print("2");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Boolean Expressions
Consider the following boolean expression. (X && !Y) || (!X && Y) Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Boolean Expressions
Consider the following code segment. boolean a = true, b = false; if (/* missing code */) System.out.print("Nice job."); else System.out.print("Nicer job.");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 316
Page 11 of 32