Search:

Type: Posts; User: Norm

Search: Search took 0.20 seconds.

  1. Replies
    18
    Views
    802

    Re: help with this question

    Try debugging the code by adding println() statements to print out the values as they are computed so you can see where the code is going wrong.
  2. Replies
    18
    Views
    802

    Re: help with this question

    How is the value 22 computed? Can you show how it is is computed by doing it manually and typing in the values that would be added to the count?
    Show it in two or more columns:
    the char // the...
  3. Replies
    18
    Views
    802

    Re: help with this question

    What is the problem with the code now?
    What does it print out now?
    What do you want it to print?
  4. Replies
    18
    Views
    802

    Re: help with this question

    Why multiply by 2 if the String length is divisible by 4 inside of the for loop?

    Most of the comments are redundant.


    // this tests to see if the symbol at the position of the String at i is...
  5. Replies
    18
    Views
    802

    Re: help with this question

    Please add some comments to the code describing what the statements are trying to do.
    For example, what is this statement for:

    if( s.length() % 4 == 0){
  6. Replies
    18
    Views
    802

    Re: help with this question

    Don't do it all in one line of code. Break it up into steps
    Validate the char
    if valid compute the index
    use the index

    edit: better order (as per Greg)
  7. Replies
    18
    Views
    802

    Re: help with this question

    The index into an array needs to be from 0 to the array's length-1.
    The code needs to map the char values it gets into that range, for example: 'a' gives 0 and 'z' gives 25

    You can do math with...
Results 1 to 7 of 7