Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static boolean successfulAttendance(){
- boolean result;
- double random = Math.random();
- double percentage = getPercentageFromTime();
- if(random<percentage){ //percentage = 0.3
- result = true;
- } else {
- result = false;
- }
- return result;
- }
- private static void distributionOfWins(){
- int amountOfTrue = 0;
- int amountOfFalse = 0;
- System.out.println("Durchgänge: " + Integer.MAX_VALUE + " Gewinnwahrscheinlichkeit: " + getPercentageFromTime() * 100 + "%");
- for (int i = 0; i < Integer.MAX_VALUE; i++){
- if (successfulAttendance()){
- amountOfTrue++;
- } else {
- amountOfFalse++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement