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 171–180 of 681
  1. 171
  2. 172
  3. 173
  4. 174
  5. 175
  6. 176
  7. 177
  8. 178
  9. 179
  10. 180

Question 171

Multiple choice Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 681
Page 18 of 69