CS253 Project 1: C Programming with Strings

Due Friday, March 6, at 12:00 PM
The Ceasar cipher, or shift cipher, works by shifting each letter of a phrase by a given number of places. Letters wrap around the alphabet, so z shifted by 2 is b. This seems like quite a simple cipher, but has seen historical use by the highly successful Roman armies under Julius Caesar. The effective key space of this cipher is only 25, because a shift of 0 or 26 leaves the message unchanged, and a shift of 27 is equivalant to 1, etc.
The program should take a single command-line parameter, which is the shift, and should default to 13 if no shift is specified. The text to encrypt or decrypt will be provided to your program on standard input, and the encrypted version should be output on standard output. Feel free to borrow whatever you like from the stream adder in-class example. The program must use C strings rather than the C++ string class, but any other aspect of C++ can be used. If your program will not compile with a C compiler, use a c++ file extension. Options include .cc, .cxx, .cpp, .c++, or .C (capital c).
Turning in the program
Contrary to the lab turn-in convention, upload the source code for your completed program here.