Question: C++ Caesar Shift Cipher: read in a STREAM of text, (not just a line, a stream of arbitrary length, ) a char at a time,

C++ Caesar Shift Cipher: read in a STREAM of text, (not just a line, a stream of arbitrary length, ) a char at a time, and as you do so, shift each letter forward in the alphabet a certain number of places. The number of places is read from the command line in argc[1], and turned into an int with: int shift = atoi(argc[1]): Example: shift 13 Hello, Jack Urvyb, Wnpx READ THE COMMAND LINE FOR AN INTEGER IN ARGV [1] Run it through atoi() to convert the command line string to an integer: int shift = atoi(argy[1]): Here's the pseudocode: read in a character c if (c is a letter) { make c lowercase make c a number between 0 and 25 add the shift value to c mod c so it's between 0 and 25 again add a 'a' to c so it's a real ASCII letter again. } print c on the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
