Search:

Type: Posts; User: Norm

Search: Search took 2.44 seconds.

  1. Replies
    9
    Views
    1,397

    Re: Java int comparison

    Before writing any code, decide what the code is supposed to do.
    When to test if there is some input
    when to print out an error message
    when to read the input
    when to use the input
  2. Replies
    9
    Views
    1,397

    Re: Java int comparison

    The hasNext methods do not read any data. They test if data is available to be read.
    The next methods do read data that should be assigned to a variable so it can be used later.
    This statement does...
  3. Replies
    9
    Views
    1,397

    Re: Java int comparison

    What happens to the number that is inputted by the user in that statement? Where does it go?

    You should first read it into a variable, THEN test it in case you want to use it.
  4. Replies
    9
    Views
    1,397

    Re: Java int comparison

    Where is that message? I don't see it in the posted code.



    else if(userNum.nextInt() < 0 )
    What is done with the number read by nextInt() in the above statement?
    It needs to be assigned to...
Results 1 to 4 of 4