Google Answers Logo
View Question
 
Q: Programming in Java "Deitel & Deitel" ( No Answer,   2 Comments )
Question  
Subject: Programming in Java "Deitel & Deitel"
Category: Computers > Programming
Asked by: pucspifo-ga
List Price: $20.00
Posted: 26 Aug 2002 22:27 PDT
Expires: 27 Aug 2002 07:06 PDT
Question ID: 58942
Java programming, how do I solve creating a Morse Code translator as
in Deitel & Deitel "Java How to Program4th Edition" question 10.27?

Request for Question Clarification by secret901-ga on 26 Aug 2002 22:43 PDT
Would you post the full text of the question?

Clarification of Question by pucspifo-ga on 26 Aug 2002 23:01 PDT
Write an application that reads an  English language phrase and
encodes the phrase into Morse Code and also converts a Morse Code
phrase into a plain English phrase.  Use one blank space between each
Morse Coded letter and three blank spaces between each Morse-coded
word.  Use two parallel arrays to store the alphabet and Morse Code.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Programming in Java "Deitel & Deitel"
From: secret901-ga on 26 Aug 2002 22:52 PDT
 
http://www.calstatela.edu/faculty/ppartow/cis457_syllabus.html
Subject: Re: Programming in Java "Deitel & Deitel"
From: secret901-ga on 26 Aug 2002 23:30 PDT
 
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

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy