Program 2: Caesar Cipher

Purpose

The purpose of this assignment is to design and implement a Java program that uses both decision constructs and iteration constructs to implement a Caesar Cipher.

Partners

You may (and are encouraged to) work with at most one other partner on this assignment. You and your partner must be in the same lab section. If you work with a partner, submit one solution with both of your names on it.

Assignment

Create a BlueJ project named Program2 and place this Driver.java file in it. Your task is to add the missing CaesarCipher.java file to the project such that when the Driver program is run, it might produce this output. You may assume that when the program is run, the user commits no input errors. Specifically, the user

Caesar Cipher Background

Read this Wikipedia article to learn more about how a Caesar Cipher works. For this assignment, the empty space character (' ') should always be encoded to the number 0, regardless of the key. Notice that both uppercase and lowercase letters can appear in a message to be encoded, but only lowercase letters will appear in a decoded message. Finally, all other characters (such as the period, '.') should encode and decode to themselves.

Grading (50 points possible)

Helpful Hints

Submission

E-mail the CaesarCipher.java file as an attachment to your lab TA no later than the start of your lab on Tuesday, October 14th. Late submissions receive no credit, but partial credit can be earned by making an ontime submission. The subject of the e-mail should be CS 160, Program 2, your name, your partner's name.

Valid XHTML 1.0!