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
.
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 2Step 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