Question: Description A Caesar cipher (http://en.wikipedia.org/wiki/Caesar_cipher) is a simple cryptographic technique in which each letter is the original message is shifted to a different letter which

Description

A Caesar cipher (http://en.wikipedia.org/wiki/Caesar_cipher) is a simple cryptographic technique in which each letter is the original message is shifted to a different letter which is located at a uniform offset in alphabetic order. For example, the message Hello World! and offset 3 would result in an encrypted message Khoor Zruog! The message Dogs and Cats and offset -2 (which is equivalent to an offset of 24) would result in an encrypted message Bmeq ylb Ayrq. Note that only alphabetic characters are shifted, and that the case of the letter is preserved.

Functional requirements

Write a Unix program that takes 3 inputs from the command line: the pathname of an existing input file, the pathname of an output file to be created, and an offset between -25 and 25, inclusive. If the input file doesnt exist, or if the output file cannot be created (perhaps because directories in its path do not exist, or because you dont have permission to create files in the given location), or if the offset is out of range, the program prints an error message to standard error and immediately ends. Otherwise it uses the input file and offset to create an encoded output file using the Caesar cipher as described above.

Nonfunctional requirements

You may use the C++ string class, fstreams and stringstreams. To convert the 3rd command line argument from a c-string to an int, use stringstreams or the atoi function from stdlib.hhttp://www.cplusplus.com/reference/clibrary/cstdlib/atoi/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!