Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Uryyb, 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(argv[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
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