Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    l = phrase.charAt(i);
    First you need to change the name of the variable that is assigned the value returned by the charAt() method.
    l is not a good variable name. It is hard to talk about the...
  2. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    The code doesn't appear to be testing the value of the char variable assigned the value returned by charAt().
    BTW l is a very poor variable name. It looks too much like the digit 1. In general...
  3. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    '1' is a char and "1" is a String. Their values are not the same as the int: 1.

    The charAt() method returns a char like '1', it does NOT return an int value like 1.

    Change the code to work with...
  4. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    All the input are char values. None of the input is int. The char: '1' or the String: "1" does not have the same value as the int: 1.
    To see the values of the characters, look at an ASCII...
  5. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    Looks like the output is missing the leading h and the ending numbers.

    Try debugging the code by adding some println statements that print out the values of variables as they are changed so you...
  6. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    Please copy and post the console contents that shows what was input to the program and what it printed out.
  7. Thread: Morse Problem

    by Norm
    Replies
    23
    Views
    1,194

    Re: Morse Problem

    Does it execute and give you the desired results?
Results 1 to 7 of 7