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.

Questions 341–350 of 776
  1. 341
  2. 342
  3. 343
  4. 344
  5. 345
  6. 346
  7. 347
  8. 348
  9. 349
  10. 350

Question 341

Free response Using Objects
DNA sequencing and matching has become a standard technique in medical research, forensics, and recreational genealogy. A DNA molecule encodes genetic…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 342

Multiple choice Primitive Types
Consider the following Java statements: double x = 2.5, y = 1.99;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 343

Multiple choice Using Objects
Consider the following code segment: String abc = "AAABBBCCC"; String abc1 = abc.substring(0, abc.length() - 1); abc1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 344

Multiple choice Primitive Types
Suppose a, b, and c are positive integers under 1000, and x satisfies the formula \[ \frac{a}{b} = \frac{c}{x} \] The integer value d is obtained by truncating…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 345

Multiple choice Using Objects
Consider the following code segment: int x = (int)Math.pow(2, 5);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 346

Free response Using Objects
Consider the following incomplete class definition: /** Returns a new string as described in part (a). * Precondition: All letters in text are uppercase; * 0 <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 347

Free response Using Objects
This question involves two classes that are used to process log messages. A list of sample log messages is given below. CLIENT3:security alert - repeated login…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 348

Multiple choice Using Objects
Consider the following code segment: String str = "012345"; for (int i = 0; i < str.length() - 1; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 349

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 350

Free response Using Objects
A high school Casino Night event offers a game of chance in which a player can buy a ticket to have a low-probability chance at winning a fixed prize. (All…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 341 of 776
Page 35 of 78