I have reason to believe that this is homework assignment (See above
comment). While Google Answers does condone the posting of homework
question, it is agains my ethics to give a straightforward answer.
However, I can give you some pointers:
1) When the book tell you to use two parallel arrays to store the
alphabet and the Morse Code, you should have two public static final
arrays in your code like this:
public static final char[] ENGLISH_ALPHABET = {'a', 'b', 'c', ...};
public static final String[] MORSE_CODE = {".-", "-...", "-.-.", ...};
Then, you should have two methods defined below:
public String encode(String text);
//returns the encoded representation of text. You should have a String
called
//toReturn that concatenates itself to an appropriate Morse Code and a
space
//as it traverse through every letter in text.
public String decode(String code);
//returns the decoded message of code. You should do the same thing
as above,
//substituting ENGLISH_ALPHABET with MORSE_CODE |