Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

.image text in transcribed

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

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

=+2 Is the decision sustainable in the long run?

Answered: 1 week ago