Search:

Type: Posts; User: robingeldolf

Page 1 of 2 1 2

Search: Search took 0.08 seconds.

  1. Replies
    5
    Views
    2,821

    Re: lucky numbers

    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.
  2. Replies
    5
    Views
    2,821

    Re: lucky numbers

    i don't know how to remove something from an array, that the problem. And don't really see another approach
  3. Replies
    5
    Views
    2,821

    lucky numbers

    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...
  4. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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...
  5. Replies
    7
    Views
    2,449

    Re: board of galton,simulation.

    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...
  6. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    But i don't know what to do if i converted the string
  7. Replies
    7
    Views
    2,449

    Re: board of galton,simulation.

    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.
  8. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    int i = Integer.parseInt(s);??
  9. Replies
    7
    Views
    2,449

    Re: board of galton,simulation.

    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...
  10. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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...
  11. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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...
  12. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    do {
    System.out.println("Hoeveel simulaties wil je uitvoeren?(minimaal 0,maximaal 1000)");
    aantalSimulaties = Input.readInt();
    }
    while ( aantalSimulaties <= 0 || 1000 <= aantalSimulaties...
  13. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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...
  14. Replies
    7
    Views
    2,449

    board of galton,simulation.

    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...
  15. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how 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....
  16. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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();...
  17. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    else if(keuze.equals("2")) {
    keuzes2();
    AantalSim();
    keuzes2a();
    }
    public void keuzes 2() {
    do {
    System.out.println("Hoeveel simulaties wil je uitvoeren?(maximaal...
  18. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    Re: how to?

    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 ++) {...
  19. Thread: how to?

    by robingeldolf
    Replies
    24
    Views
    1,588

    how to?

    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") );...
  20. Thread: how to?

    by robingeldolf
    Replies
    4
    Views
    953

    Re: how to?

    y <= number

    thank you very much
  21. Thread: how to?

    by robingeldolf
    Replies
    4
    Views
    953

    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...
  22. Thread: how to?

    by robingeldolf
    Replies
    4
    Views
    953

    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...
  23. Replies
    4
    Views
    1,664

    Re: rock paper si

    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;
    ...
  24. Replies
    4
    Views
    1,664

    Re: rock paper si

    public class Bladsteenschaar5 {
    public void speel() {

    final int BLAD = 0;
    final int STEEN = 1;
    final int SCHAAR = 2;
    int keuzeSpeler = 0;

    //...
  25. Replies
    4
    Views
    1,664

    rock paper si

    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...
Results 1 to 25 of 26
Page 1 of 2 1 2