-
how to?
I have to let the user press in a number, and the number that is being inserted is the amount that the program has to run.
so i have this already
System.out.println("How many simulations do you want");
numberSimulations = Input.readLong();
for ( y = 0 ; y = numberSimulation ; y ++) {
SimulationThatHasToBeDoneXNumberOfTimes();
this way doesn't work because it has to be boolean,can anyone tell me another way of doing this??
-
Re: how to?
y = numberSimulation
A single equals is assignment. A double equals is comparison. Do you really want the loop to execute ONLY when y equals numberSimulation?
-
Re: how to?
if the input is 100, the loop has to be done 100 times but i don't think for is the right way.
i have to run SimulationThatHasToBeDoneXNumberOfTimes(); an amount of times==>that amount is chosen by the user(input)
-
Re: how to?
I understand, I want you to think about it. If numberSimulation is 100 and y is 0 what should the condition of your loop be?
-
Re: how to?
y <= number
thank you very much