Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    You can't stop the user from entering anything he wants to enter.
    You can refuse to accept input that is not valid.
    That implies having a loop that doesn't exit until the program gets the desired...
  2. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    Defining it outside of any methods will make it a class variable.
  3. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    How many times did you execute it? I executed it about 10 times. Sometimes the numbers were the same and sometimes they were different.

    Try defining the Random class object outside of the method...
  4. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    It doesn't on my system. What OS and version of java are you using?
  5. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    Can you write a small simple program that compiles, executes and shows the problem?
    Execute the code, copy the console contents that show the problem and paste it here.
    When I execute the code I...
  6. Replies
    17
    Views
    1,797

    Re: Help with simple math game coding

    What number do they return? It is possible for a random number generate the same number more than once.
Results 1 to 6 of 6