Answered step by step
Verified Expert Solution
Link Copied!

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,

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago