Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    Think of a 4 digit number as the sum of 4 numbers. Say the number is 2345
    That is the sum of
    2000
    300
    40
    5

    To strip off the loworder 0, divide the number by 10
    40/10 = 4
    (300/10)/10 = 3
  2. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    If you are going to use Strings you should read the API doc for the String class and see what methods it has for working with the characters in the String.
    The API doc: Java Platform SE 7
  3. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    Which method of the two I suggested can you try?
    Converting to a String is the easier.
  4. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    Those are the operators for this. Getting the rightmost digit is easy. I've not tried getting the leftmost first.
    Or convert the number to a String and use the String class's methods.
  5. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    Can you explain and give an example? What is a "particular number"?
    Given 1234
    Could the "particular number" be the digit in the second position: '2'
    Or if the "particular number" is a 3 then...
  6. Replies
    13
    Views
    1,311

    Re: Question about homework problem.

    Can you explain and give an example? Is there a word missing after the word particular?
Results 1 to 6 of 6