i need to now how i can put the output from this code
for( int j = 0 ; j < start.length; j +=2 ) {
System.out.print( start[i] + " ");
into a new for loop.
Type: Posts; User: robingeldolf
i need to now how i can put the output from this code
for( int j = 0 ; j < start.length; j +=2 ) {
System.out.print( start[i] + " ");
into a new for loop.
i don't know how to remove something from an array, that the problem. And don't really see another approach
hi everyone, i have to make a java program that generates "lucky numbers" with arrays
The finishing result should be this
1 2 3 4 5 6 7 8 9 10 original
1 3 5 7 9 remove every second number...
the data in the string is used to create an amount of simulations. If the string is 100 the simulation has to run 100 times. But i want to make sure the users gives a number that is between 0 and...
ok i did what you said,but i still won't work.
I have to use the variables over 2 methods. So if i initialize them in the methods separately it doesn't work. Because it resets in each method. If i...
But i don't know what to do if i converted the string
Don't they have to be the same name, i'm adding them in 1 method,and printing them out in another method. I'm searching for a way to initialize them to zero every time they ask for a new simulation.
int i = Integer.parseInt(s);??
if i do that the input doesn't reset to zero if i want to run another simulation.If i run 5 simulations i will have 5 balls in the bottom,if i run a second simulation of 5 it wil add this to the...
i'm using the int type, i have to make sure any enter the users gives, not between 1 or 1000 gives the question again.
Is it a better way to use a string?And how do you compare al the numbers...
isn't there a way to repeat the loop so it keeps asking the amount of simulations that is required,the same way i did with the do while.
while ( aantalSimulaties <= 0 || 1000 <= aantalSimulaties...
do {
System.out.println("Hoeveel simulaties wil je uitvoeren?(minimaal 0,maximaal 1000)");
aantalSimulaties = Input.readInt();
}
while ( aantalSimulaties <= 0 || 1000 <= aantalSimulaties...
One more problem now, the loop has to repeat if the number isn't between 0 and 1000, but if the use enters a letter is has to loop aswell. How to do this without including the intire alphabet to the...
I have a project for java,i have to simulate the board of galton(Galton Board -- from Wolfram MathWorld).
My simulation code is ready but i'm having some final problems. I have to reset a value to...
if they press -1 or -12 is has to loop and if they press 1010 or 1020 it has the loop ,but you can only give one number at a time.
So better use the OR? Thanks for the help,my problem is solved....
I've changed it to tis but it still won't work.
public void keuzes2() {
do {
System.out.println("how many simulations do you ant to do(maximaal 1000)");
amountofsim = Input.readInt();...
else if(keuze.equals("2")) {
keuzes2();
AantalSim();
keuzes2a();
}
public void keuzes 2() {
do {
System.out.println("Hoeveel simulaties wil je uitvoeren?(maximaal...
do you mean like this
do {
System.out.println("Hoeveel simulaties wil je uitvoeren?(maximaal 1000)");
aantalSimulaties = Input.readInt();
for ( y = 0 ; y < aantalSimulaties ; y ++) {...
i have to make sure the user presses a number between 0 and a 1000 , but i'm not sure how to do it.
For other cases i used while ( !keuze.equals("1") && !keuze.equals("2") && !keuze.equals("3") );...
y <= number
thank you very much
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...
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...
i fixed it, thanks. used do while .
public class Bladsteenschaar6 {
final int blad = 0;
final int steen = 1;
final int schaar = 2;
int computer;
int keuzeSpeler;
...
public class Bladsteenschaar5 {
public void speel() {
final int BLAD = 0;
final int STEEN = 1;
final int SCHAAR = 2;
int keuzeSpeler = 0;
//...
hi, got a problem with my code i'm getting the following error
Bladsteenschaar5.java:39: illegal start of expression
public void speelde(){
^
Bladsteenschaar5.java:39: illegal start of...