CSCI 2341 Submission 02
Vigenere Encoding and Decoding Messages
|
Supplied file(s) (copy from $sup02) |
DemoVigEncDec2.jar (the demo executable) VigEncDec2.txt (the TextItems file of program description)
|
|---|---|
| Files to submit |
VigEncDec2.jar (your executable jar file) VigEncDec2.java (your source code file) my_tests.sh (your completed testing script)
|
| Where to put them |
Copy them to your u##/submissions/s02
subdirectory.
|
| When they're due | Sunday, October 12, 2025 @11:59pm |
This second submission is the second part of the two-part submission sequence involving Vigenere encoding/decoding. So ... this week you will extend your Java program solution to the previous submission so that it can encode or decode a single-line message of arbitrary length consisting of uppercase letters and possibly one or more blank spaces. A blank space is not encoded in any way and just remains in its original position within the message. The same Vigenere square from the previous submission is again used to encode or decode each letter in the message.
When run with no input parameters, the program behaves analogously to the program of the previous submission. That is, it displays an opening identification screen, followed by a program description, which this time consists of two screens of output.
When encoding or decoding, a run of the program performs the encoding or decoding of a single message, and requires three command-line inputs. The first input must be a lowercase e or d to indicate encoding or decoding. The second is the message to be encoded or decoded, which must be enclosed in double quotes if it contains one or more blank spaces. And the third is the key, which must be string of one or more lowercase letters containing no blank spaces.
There is one additional aspect of the encoding/decoding scheme that you need to understand, and it is best explained with an example. Typically the message will be longer than the key, so suppose for example that the message is COME ON THE TITANIC and the key is iceberg. Then the seven letters of iceberg will be used to encode the seven letters in COME ON T (in the same order), and then we start over with the same key. That is, the seven letters of iceberg will now be used again to encode HE TITAN (the next seven letters of the message). And finally the first two letters of iceberg (namely, ic) will be used to encode IC (the last two letters of the message). Somewhat coincidentally, the first two letters of the key are the lowercase versions of the last two letters of the message, which is mildly interesting. Note again, blank spaces are not encoded and are simply retained where they occur in the message. The point is that it doesn't matter how long the message is ... we just keep using the letters of the key over and over till all the letters in the message have been encoded (or decoded, since, once again, the procedure for decoding a message is just the reverse of the encoding procedure, also one letter at a time).
fjc command to help you with your formatting.
my_tests.sh testing script, modeled after the one you
were given for Submission 01.