vendredi 15 mai 2020

Random Selection from Names based on Weightage

I have a list of Options and their values as below

Ram 25% Mohamed 25% Samuel 25% Karthik 25%

Based on this I need to Print some 20 rows.

So the result should have all the four names printed 5 times each making 20 names.

For ease, I have given the number of result rows as 20 and the options are equally distributed as 25% each. They all may vary.

I am looking for good program in Java. Any ideas?




Aucun commentaire:

Enregistrer un commentaire