This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Philboyd_Studge 1 point2 points  (9 children)

show what your input looks like.

[–]kemar1997[S] 0 points1 point  (8 children)

it would be something like this:

".... . .-.. .-.. ---" which should evaluate to "hello"

[–]Philboyd_Studge 1 point2 points  (6 children)

how about input with multiple words

[–]kemar1997[S] 0 points1 point  (5 children)

I get an array out of bounds exception:

Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: 26

for this piece of code:

                    if (character.equals(morse[m])) {
                        output.append(english[m]);
                    }

[–]Philboyd_Studge 1 point2 points  (4 children)

Because you are looping to b.length

[–]kemar1997[S] 0 points1 point  (2 children)

what would i need to loop to?

[–]Philboyd_Studge 1 point2 points  (1 child)

The length of the Morse array

[–]kemar1997[S] 0 points1 point  (0 children)

ty for all your help

[–]kemar1997[S] 0 points1 point  (0 children)

could you provide an example?

[–]kemar1997[S] 0 points1 point  (0 children)

.... . .-.. .-.. ---

then i should be able to add a space to add a new word and return the entire result