Search:

Type: Posts; User: Norm

Search: Search took 0.21 seconds.

  1. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    If the user enters a String, what methods are you allowed to use to determine if that String is all numeric digits or if it contains letters?
    One way is to use try{} catch block with an Integer...
  2. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    You must have a use for the data in the String or you would not have asked the user to enter it.
    Please explain what the data in the String is used for? Why does your program get that data?
  3. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    You have a problem with the input. You can input numbers with readInt() or you can input Strings with another method.
    But then you have to test that the String is a valid number before you can...
  4. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    What is the datatype of the variable that contains the data that you must test? Is it a number like an int or is it a String?
    That will determine what kind of conditional tests you can do in the...
  5. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    That's what happens when the user enters the wrong data.
    You can handle that exception by using try{<your code here>}catch
  6. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    How are you reading the input from the user? What datatype does the readInt() method return?
    What happens if the user does not enter a valid number?
  7. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    That's right. You can use the AND test to see if a number is in a range. A number can be both > 10 and < 20.
    There is no number that is both < 0 and > 1000.
    You want to repeat the loop if the...
  8. Thread: how to?

    by Norm
    Replies
    24
    Views
    1,592

    Re: how to?

    What value is both < 0 and > 1000?
    Would you want to loop back if either is true vs both being true?
Results 1 to 8 of 8