Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    You need to continue debugging your code to see why it is doing what it does.
    Add a println statement just before the while statement that prints out the value of the while statement's loop control...
  2. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Replace the number with the char. Use 'A' and 'z' instead of the numbers the code is using
    See curmudgeon's post#4 in this thread:
    ...
  3. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Sorry, I can't help you with code that has so many magic numbers. I don't want to have to look them up every time I see them.

    Can you explain what the steps the code should take to solve your...
  4. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Please don't use "magic" numbers like 90 and 97. I do not know what char they are supposed to be.
    Use a char value like 'A' or '9'.
    You are trying to get values from 'A' to 'z' skipping over the...
  5. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Yes, when the value is not in the range shown in the while statement, the loop will stop.

    What is the while loop supposed to do? Why have the while loop?
    You can write an expression using a...
  6. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Is 69 between 90 and 97?
  7. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    What values does it need to be for the while loop to continue executing?


    while(randomLowUp > 90 && randomLowUp < 97)
  8. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    What is printed out when you execute the code with the added println statement?
  9. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Can you explain what the confusion is? I suggested you add a println statement inside and at the end of the while statement that prints out the value of the variable the controls the while...
  10. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Did you add the println statement i suggested?
    What is the value of the while loop's controlling variable that is printed out?
    What values in that variable will stop the looping? Was the printed...
  11. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    What is the value of the while loop's controlling variable that is printed out?
    What values in that variable will stop the looping?
  12. Replies
    23
    Views
    2,577

    Re: Java Math.random() and loop

    Add some println statements inside and at the bottom of the loop that prints out the values of the variable(s) that control the looping in the while statement. Seeing the values of the variables...
Results 1 to 12 of 12