Math.random() returns a value between 0 and 1.0
Java also has the Random class.
You can say
double mypercent = r.nextDouble() * 100.0;
which would give you a random number from 0 - 100
or
(int)(Math.random() * 6) to return integers in the range 0-5
or
(int)(Math.random() * 6) + 1 to return values from 1-6
[ February 05, 2005: Message edited by: Marilyn de Queiroz ]