vendredi 17 mai 2019

How can I generate a random boolean using percentage [duplicate]

This question already has an answer here:

I have to generate a random boolean with percentage. I mean that I can for example say:

boolean randomBoolean = generateRandomBooleanWithPercantage(90)

Then the probability that it's true should be 90%.




Aucun commentaire:

Enregistrer un commentaire