Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice 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.

Subtopic: Using Objects Clear filter

Questions 171–180 of 546
  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 class definition. public class WordPlay { private String word; public WordPlay(String w) { word = w; } public void update(String first) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 172

Multiple choice Using Objects
What output will be produced by the following?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 173

Multiple choice Using Objects
/** Returns true if the 4-digit integer n is valid, * false otherwise. */ boolean checkNumber(int n) { int d1,d2,d3,checkDigit,nRemaining,rem; //strip off…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 174

Multiple choice Using Objects
/** Returns true if the 4-digit integer n is valid, * false otherwise. */ boolean checkNumber(int n) { int d1, d2, d3, checkDigit, nRemaining, rem; //strip off…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 175

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 176

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 177

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 178

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 179

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 180

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 171 of 546
Page 18 of 55