A problem you may be facing is dividing two int
and expecting a double
result
int trials = 0;
int winCounter = 0;
double average;
average = winCounter / trials;
What's going to happen divding two int
is that you will lose precision. instead make the int
into double
. Or at least one of them.
double trials = 0;
double winCounter = 0;
double average;
average = winCounter / trials;
And use in.nextDouble()