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 971–980 of 3,140
  1. 971
  2. 972
  3. 973
  4. 974
  5. 975
  6. 976
  7. 977
  8. 978
  9. 979
  10. 980

Question 971

Multiple choice Unit 2: Selection and Iteration
Consider the following incomplete method. public boolean validation(int x, int y) { /* missing code */ } The following table shows several examples of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 972

Multiple choice Unit 2: Selection and Iteration
Consider the following method. public String calculate(int num1, int num2) { if (num1 >= 0 && num2 >= 0) return "Numbers are valid"; return "Numbers are not…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 973

Multiple choice Unit 2: Selection and Iteration
Assume truth1 and truth2 are boolean variables that have been properly declared and initialized. Consider…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 974

Multiple choice Unit 2: Selection and Iteration
Assume that the variable declarations have been made. int a = 7, b = 15, c = -6; Which will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 975

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int k = 0; k < 20; k = k + 2) { if (k % 3 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 976

Multiple choice Unit 2: Selection and Iteration
At a certain high school students receive letter grades based on the following scale. Numeric Score Letter Grade 93 or above A From 84 to 92 inclusive B From 75…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 977

Multiple choice Unit 2: Selection and Iteration
Consider the following output. 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 978

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int num1 = 9; int num2 = 5; if (num1 > num2) { System.out.print((num1 + num2) %…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 979

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int value = initValue; if (value > 10) if (value > 15) value = 0; else value =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 980

Multiple choice Unit 2: Selection and Iteration
Assume that a, b, and c have been declared and initialized with int values. The expression !(a > b || b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 971 of 3,140
Page 98 of 314