lundi 9 février 2015

random number with range and multiplier in java

I'm trying to generate a random number within a range, and of a specific multiple. My example would be within the range of 60 - 500, and only multiples of 5, e.g. 60, 65, 70 -> 500


I'm trying to use random.nextInt(), but I can either get the range to work, or the multiplier, but not both.


Any assistance would be greatly appreciated!





Aucun commentaire:

Enregistrer un commentaire