Supplied files
(copy from $sup01)
DemoVigEncDec1.jar (the demo executable)
VigEncDec1_shell.java (a starter shell for your source code file)
VigEncDec1.txt (the TextItems file of program description)
jar_b.sh (a script for building your executable jar file)
my_tests_partial.sh (a partial testing script)
Files to submit VigEncDec1.jar (your executable jar file)
VigEncDec1.java (your source code file)
my_tests.sh (your completed testing script)
Where to put them Copy them to your u##/submissions/s01 subdirectory.
When they're due Sunday, September 28, 2025 @11:59pm

Important Documents (for this and all subsequent submissions)

A summary of our Java coding style rules to which you should pay close attention is given here: Style Rules

The course policy on cheating is given here: Policy on Cheating

Overview

This first submission is the first part of what is essentially a two-part submission sequence designed to get you "up and running" and give you some practice in the very important practice of "iterative development". For this first part you will design and write a Java program that can encode or decode a single uppercase letter input from the command line using a Vigenere encoding/decoding scheme, and write the corresponding encoded or decoded uppercase letter out to the screen. Each run of the program performs either the encoding or the decoding of a single uppercase letter. There are also three kinds of errors that that program must recognize if they occur. In each case the program must display an appropriate message, followed by a pause, and then terminate.

When the program is run with no command-line input, it first displays an opening screen containing programmer and program identification information, and then a second screen of program information. Each screen has a pause at the end, and the program terminates after the second screen. The first screen must be produced with the instructor-supplied OpeningScreen class, and the second with the instructor-supplied TextItems class (in conjunction with the supplied VigEncDec1.txt file).

The program, and all its resources, must be placed in, and must run from, an executable jar file. Thus a first order of business, is to make sure you know how to create an executable jar file and place within that jar file all the necessary files for the program to run as a stand-alone, single file. For this first submission you are given the file jar_b.sh for building the required jar file. For subsequent submissions you will want to create and use an appropriately modified copy of this file.

To design the program you need to understand, of course, how the Vigenere encoding/decoding scheme works, and that is described next.

The Encoding/Decoding Scheme (read very carefully)

First, a little history: The Vigenere cipher, which is one example of a "polyalphabetic substitution cipher", has a rich history starting with its initial descriptions by Giovan Battista Bellaso in 1553 and Blaise de Vigenere in 1586. While credited to Vigenere, the cipher was also developed independently by Bellaso and is considered a hybrid of Bellaso's cipher, Trithemius' cipher, and Vigenere's autokey cipher. For centuries, it was believed to be unbreakable, earning it the description "the indecipherable cipher", but was eventually cracked by Charles Babbage and Friedrich Kasiski in the mid-19th century. And, of course, today there are more secure alternatives.

Essentially the Vigenere cipher is a method of encrypting alphabetic text where each letter of the plaintext is encoded with a different "Caesar cipher" (another, simpler, kind of encoding/decoding scheme actually used by Julius Caesar), whose increment is determined by the corresponding letter of another text, the key. There are many versions of the Vigenere cipher, but we will use perhaps the simplest one, which uses the following "Vigenere square":

Vigeere Square

Once you have this square, the encoding or decoding of a single uppercase letter using a single lowercase letter as the key is quite straightforward. For example, suppose you want to encode the uppercase letter P using the lowercase letter f as the key. In this case P is encoded by the uppercase letter U, since U is in row f and column P. The encoding of any other uppercase letter using any other lowercase letter as the key would proceed analogously. Furthermore, the decoding process is simply the reverse of the encoding process.

We are using only uppercase and lowercase letters, but for reference you can find a complete ASCII table (which, of course, contains those characters) here.

Steps to Perform

  1. Download and run the VigEncDec1.jar executable jar file to see what your program output should look like when you run it with no command-line input, and pay particular attention to the second output screen, which contains the program information. Note that this information is available to you in the supplied TextItems file VigEncDec1.txt, which your program must also display in a similar manner.
  2. Study the encoding/decoding scheme described above. It will be very helpful to work through, by hand, the encoding and decoding of several uppercase letters of your choosing, to confirm that you really do understand the encoding/decoding scheme.
  3. Run the sample executable jar file to encode and then decode several different uppercase letters to confirm that program behaves as it should.
  4. Also run the program several different times with invalid input to generated each of the three possible error messages.
  5. When you understand how your program is to work, first design, then write and test, a Java program that performs the required task. When you begin to write actual code, start with the supplied shell program (VigEncDec1_shell.java) and be sure to follow the appropriate rules and guidelines. Each of your methods should be preceded by a short javadoc comment describing what the method does, along with any other comments that might be required to explain your code. Of course, your code should be so clear that such comments should be minimal.
  6. When the program is working correctly, make a final check before submission to ensure your source code is identified, formatted, and documented properly.
  7. Be sure as well that you have completed the self-assessment comment of your submission to inform the marker either that everything is complete and working according to the specifications, or to inform the marker of what is still missing or not working properly in your submission.
  8. Finally, submit the required files to the required subdirectory in your server account (see above).
    Double check to make sure that your submitted files have the correct names. Also, do not develop your solution in the directory where it will be submitted. There should never, at any time, be anything but one or more of the files required for the associated submission in the submission directory for that submission.

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

  1. Here is a program development hint: Don't worry at the beginning about checking for errors. Get your program working properly for no command-line input first, then for valid input, and finally for invalid input.
  2. For this program you must make appropriate use of the following three instructor-supplied classes, since they will save you a considerable amount of "busy work": Be sure that you understand how to use each of these classes in its "standalone" context before trying to incorporate them into your program. You will be using these same classes in more or less the same way throughout the course, so at the beginning of the course is the time to get comfortable with them. Both the classes themselves and the class documentation are available here, and, though the classes may be downloaded from the website, you should be working directly on the server, and accessing the classes there.
  3. To complete this submission you will, of course, need to know how to create an executable jar file, and how to include in such an executable file the textfile of program usage information that your program will need to display on the screen after the opening screen. For this first submission this is made easy for you by the supplied jar_b.sh script, which "knows" where the instructor-supplied files listed above are located on the server.
  4. Note that although several files are required for this program, you submit only three files: your VigEncDec1.java source code file, your VigEncDec1.jar executable jar file, which contains all of the necessary files for the complete program and which can be run from the command line, and your my_tests.sh testing script, to which you must have added some additional test runs.
    These files must be included in your VigEncDec1.jar file (which will be created when you run the jar_b.sh script):
  5. We will also discuss the required file my_tests.sh and the partially complete version of this file supplied with the assignment, which you must complete by adding additional tests. For subsequent assignment submissions to your server account, you will have to create your own testing script, but you can use this one as a model, by taking a copy and making appropriate modifications for each new submission.
  6. And here is a short reminder list of (just some) of the style requirements you need to know and remember when doing this submission (these are ones that tend to be ignored or overlooked and they will be required in all subsequent submissions as well, so get used to using the fjc command for help with formatting your source code):
  7. Don't forget to apply the acid test to your final VigEncDec1.jar file: To do this you first make a copy of your jar file in a new directory that is otherwise empty, then you open a command window on that directory and try to run your jar file at the command prompt in that directory. If it does not run properly there, you have done something wrong, and the marker will not be able to run your jar file either. And by the way, if you have placed your source code in a Java package, that is one reason that may cause your jar file to fail the acid test!