3.1.1.8 Random Number Generation In Programming Languages. Flashcards
1
Q
Syntax for random number generation.
A
int ran = Math.random( );
2
Q
Syntax for number generator between two values.
A
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);