Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me with this problem.

 
Stephen Norris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am suppose to write a program that will convert English to Morse code and Morse code to English. I am just terrible at this stuff and need a lot of help. Below is further instructions on my program.
INSY 3300/INSY 5309: Intermediate Computer Programming
Fall 2003
Due: Dec. 2 (Tuesday)
Programming Assignment #5: String Manipulation (20 points)
Complete Exercise 11.27 from the TextBook (p566-567).
� Create TWO APPLICATION
o MorscCode.java: To convert Characters into MorseCode
o MorseToNormal: To convert MorseCode into Normal Characters
� You have to use String arrays which contain characters or morse code.
� You may use any kind of GUI such as JLabel, JTextField, JTextArea, or JButton.
� For MorseCode.java, the program first determines whether the entered data are numbers or letters, using the following code:
char alpha //contain the first character of the input field Character.isDigit ( alpha)// return true if alpha is a number Character.isLettcr ( alpha)//return true if alpha is a letter
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, break it down into pieces. I see three major chunks: the encoder, the decoder, and the GUI.
The encoder is easier. You just need an array holding the Morse code strings for each letter; encode a message by looking up each character one by one using its Unicode value (minus an appropriate offset) as an index.
The decoder is a little trickier; although the assignment implies you can do it the same way, and you could, I suppose, it's still a bit more complicated. Instead you'd have to do a linear search through the array of codes to find the letter.
Save the GUI until last, when the other stuff is tested and works.
 
Stephen Norris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I swear that I pay attention in class, but that does not sound even close to familiar to me. I am just not sure what I am doing, but thank you for trying to help.
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Ok ok, calm down first. You can't work or think if you panic. Sorry to tell this, I have no idea about mose code, but I am really sure if you help me in mose code I will certainly help you to write the program. I have some doubts, I will list them done.
1) Is there a mose code for every letter in the english alphbet?.
2) What about the spaces and the signs such as . , / *.
3) If you say 'hi' in english, do we have to convert letter by letter?.
I am sure if you answer these questions, I can certainly help you.
Keep cool....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic