• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Please help me with this problem.

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic