Генерира случайно число, използвайки класа Java Random.
Случайна ранг = нова Случайна ();
rand.nextInt (Math.abs ((firstChoice - secondChoice)) + 1) + Math.min (първа стъпка, secondChoice);
Код на GitHub: https://github.com/amandafarrell/RandomNumberGenerator