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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started