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

Overview

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).

Steps to Perform

  1. Run the supplied sample executable with and without command-line arguments until you are comfortable with how the program is to work. Use no command-line input, valid input, and invalid input, and take note of the output formatting in all cases, since your program must emulate the sample executable behavior.
  2. Review the Vigenere encoding/decoding scheme described in the last submission, if necessary, as well as the added feature described above.
  3. When you understand how your program must work, first design, then write and test, a Java program that performs the required task. Note that you are not given a starting "shell program" this time around, so you should take another look at the shell from the previous submission, since the basic structure of what you see there applies here as well (the three types of comments, and how each is used, for example).
  4. When the program is working correctly, make a final check before submission to ensure your source code is identified, formatted, and documented properly (say what each method does, and add any additional comments required to make your code clear), and make sure that you have included your self-assessment comment. Once again, be sure to use the fjc command to help you with your formatting.
  5. Finally, submit the required files by copying them to the required subdirectory in your server account (see above).
    Double check to make sure that your submitted files have the correct names, and don't forget that this time you have to prepare your own my_tests.sh testing script, modeled after the one you were given for Submission 01.

Additional Notes, Requirements, Specifications and/or Hints (if any)

  1. The contents of your executable jar file for this submission are completely analogous to those of the previous submission, so your should review those as necessary.
  2. Remember the acid test from Submission 01? It needs to be applied here as well!