Advertisement
akosiraff

Decoder

Jun 22nd, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/decoder/
  3. Create a program that decodes messages. The messages will be encoded using a Caesar cipher, with each letter being decoded by replacing it with the previous letter in the alphabet.
  4. The message: J MPWF KBWB would be decoded as I LOVE JAVA.
  5. Offer the user a menu with the following choices:
  6. 1. Decode a message.
  7. 2. Encode a message.
  8. 3. Display the alphabet.
  9. 4. Exit the program.
  10. If the user selects option 1, prompt the user to enter an encoded phrase or sentence of text. Convert it to uppercase. Decode it. Print out each decoded letter as you convert it.
  11. If the user selects option 2, prompt the user to enter a decoded phrase or sentence of text. Convert it to uppercase. Encode it. Print out each encoded letter as you convert it.
  12. If the user selects option 3, display the alphabet on the monitor screen.
  13. If the user selects option 4, the program should terminate.
  14. Your program should redisplay the menu after each translation is finished.
  15. Each task should be in its own method: load the data, display the menu, read the data/phrase entered at the keyboard, translate the encoded message, translate the decoded message, display the alphabet.
  16. Your program must also handle the spaces between the words.
  17. Do not use or anticipate any punctuation in the input.
  18. Use my examples for test data. Method Definitions on the next page.
  19. Encoded Message Decoded Message
  20. J mpwf Kbwb I LOVE JAVA
  21. Uijt jt gvo THIS IS FUN
  22. Kbwb jt nz gbwpsjuf JAVA IS MY FAVORITE
  23.  
  24. Download: http://solutionzip.com/downloads/decoder/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement