dimanche 12 juillet 2020

random num array java

I am tasked with creating an array which has to do the following: If max is 3, it will generate 10 random numbers between 1 and 3 stored in the code array. If max is 8, it will generate 10 random numbers between 1 and 8. Each time the program is run, this code array should be different. I can get a random number between 1 and 3 but I'm not sure how to get a number between 1 & 3 10 times. I'm not sure on how to approach this, any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire