Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 171–180 of 2,811
  1. 171
  2. 172
  3. 173
  4. 174
  5. 175
  6. 176
  7. 177
  8. 178
  9. 179
  10. 180

Question 171

Multiple choice Unit 1: Using Objects and Methods
Consider the following declarations in a program to find the quantity \(\text{base}^{\text{exp}}\). double base = < a double value > double exp = < a double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 172

Multiple choice Unit 1: Using Objects and Methods
Consider the squareRoot method defined below. /** Returns a Double whose value is the square root * of the value represented by d. */ public Double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 173

Multiple choice Unit 1: Using Objects and Methods
Here are some examples of negative numbers rounded to the nearest integer: Negative real number Rounded to nearest integer -3.5 -4 -8.97 -9…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 174

Multiple choice Unit 1: Using Objects and Methods
A program is to simulate plant life under harsh conditions. In the program, plants die randomly according to some probability. Here is part of a Plant class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 175

Multiple choice Unit 1: Using Objects and Methods
A program simulates 50 slips of paper, numbered 1 through 50, placed in a bowl for a raffle…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 176

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. Integer i = new Integer(20); / * more code * / Which of the following replacements for /* more code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 177

Multiple choice Unit 1: Using Objects and Methods
Refer to these declarations. Integer k = new Integer(8); Integer m = new Integer(4); Which test(s) will generate a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 178

Multiple choice Unit 1: Using Objects and Methods
Consider the following code fragment. Object intObj = new Integer(9); System.out.println(intObj); You may…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 179

Multiple choice Unit 1: Using Objects and Methods
Consider these declarations. String s1 = "crab"; String s2 = new String("crab"); String s3 = s1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 180

Multiple choice Unit 1: Using Objects and Methods
Suppose that strA = "TOMATO", strB = "tomato", and strC = "tom".…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 171 of 2,811
Page 18 of 282