| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
medium Solved by 10 students
Random Integer in a Range
< Prev
Next >

Which of the following statements correctly assigns a random integer between 25 and 60, inclusive, to the int variable rn?

A

int rn = (int) (Math.random() * 26) + 60;

B

int rn = (int) (Math.random() * 25) + 60;

C

int rn = (int) (Math.random() * 25) + 36;

D

int rn = (int) (Math.random() * 36) + 25;

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1ngvandangthanh11 0m 00s 100
#2patrickmeijer00912 0m 28s 62
#3bommasam00013 0m 46s 34
#4thewrizzler602 0m 02s -22
#5shelter200200401 0m 19s -29
#610818526514 2m 07s -57
#7zgj0731041701 1m 03s -73
#8y.seong202713 3m 22s -122
#9parth.taur22701 3m 02s -192
#10lsj0803092212 42m 38s -2,468
Items per page:
10
1 – 10 of 11

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy