Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Using Objects and Methods, 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 21–30 of 681
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30

Question 21

Multiple choice Using Objects
Consider the following method. public void numberCheck(int maxNum) { int typeA = 0; int typeB = 0; int typeC = 0; for (int k = 1;k <= maxNum;k++) { if (k % 2 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 22

Multiple choice Using Objects
Consider the following incomplete method. public int someProcess(int n) { /* body of someProcess */ } The following table shows several examples of input values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 23

Multiple choice Using Objects
Consider the following method. public String inRangeMessage(int value) { if (value < 0 || value > 100) return "Not in range"; else return "In range"; } Consider…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 24

Multiple choice Using Objects
Assume that the following variable declarations have been made. double d = Math.random(); double r; Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 25

Multiple choice Using Objects
Consider the following instance variables and method that appear in a class representing student information. private int assignmentsCompleted; private double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 26

Multiple choice Using Objects
Consider the following method. public int sol(int lim) { int s = 0; for (int outer = 1;outer <= lim;outer++) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 27

Multiple choice Using Objects
Consider the following code segment public static void test(int[] a, int y) { if (a.length > 1) { a[1] = a[1] * 2; y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 28

Multiple choice Using Objects
Given the following code: String s1 = new String("bye"); String s2 = new String("bye now"); String s3 = s2.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 29

Multiple choice Using Objects
What is the output from the following code? String s = "Computer Science is fun!"; String s1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 30

Multiple choice Using Objects
Consider the following method. public static boolean outOfRange(int value) { if (value < 0 || value > 100) return true; else return false; } Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 21 of 681
Page 3 of 69