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 661–670 of 776
  1. 661
  2. 662
  3. 663
  4. 664
  5. 665
  6. 666
  7. 667
  8. 668
  9. 669
  10. 670

Question 661

Multiple choice Using Objects
A program must generate a random integer from 7 through 19, including both endpoints, with approximately…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 662

Multiple choice Using Objects
Which range contains all and only the possible values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 663

Multiple choice Using Objects
The same random value r is used in both assignments. Which offered pair a:b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 664

Multiple choice Using Objects
Over many executions, which value of prize should occur approximately twice as often as either of the other two values?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 665

Multiple choice Using Objects
A program must generate every integer satisfying -6 <= value < 2, with approximately equal probabilities and no…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 666

Multiple choice Using Objects
Which statement correctly describes hits after the loop? int hits = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 667

Multiple choice Using Objects
For this execution only, the three calls to Math.random() return 0.125, 0.875, and 0.375, in that order. What is printed? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 668

Multiple choice Using Objects
Assume the two calls act as independent draws. Over many executions, which value of gap should be the most frequent?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 669

Multiple choice Using Objects
Which list contains all and only the possible final values of hits? double r =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 670

Multiple choice Using Objects
A bonus should be awarded with probability approximately 0.75. Which condition…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 661 of 776
Page 67 of 78