Question: C++ I need to write a code that will create a caesar cipher from an input file using only the following headers; string, iomanip, fstream,

C++

I need to write a code that will create a caesar cipher from an input file using only the following headers; string, iomanip, fstream, cmath, cstdlib, and cctype.

NO GLOBAL VARIABLES, ARRAYS, OR USER DEFINED FUNCTIONS ALLOWED

Input file would look similar to this

.C++ I need to write a code that will create a caesar

1. The first line will either be "E" or "D" for encode or decode, encode will shift the the letters to the right and decode will shift to the left.

2. The second line contains the number of shifts.

3. The third line is the sentence that needs to be shifted

4. The fourth line must also be shifted by the same amount.

The code needs to be able to ignore numbers preceeding the string and work with a varying amount of lines i.e. if there are 3 lines after the shift it must also shift the third line.

I believe we are supposed to convert the characters to 0-25, shift on that value and then convert back but i can not figure out how to.

Only the letters need to be shifted, ignore numbers and symbols.

2 1 3Atoz is encoded with offset 4 of 1--? 2 2

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!