Question
C++ ROT13 Program I amnew to C++ coding and my professor is asking us to do this program below: We will write a simple program
C++ ROT13 Program
I amnew to C++ coding and my professor is asking us to do this program below:
We will write a simple program that uses file input/output to "encrypt" the contents of a file using the rot13 substitution cipher. You will accept two command line arguments, the input file and the output file. For example assuming input.txt exists and has data:
g++ rot13.cpp -o rot13
./rot13 input.txt output.txt
Now output.txt will contain the encrypted version. Running rot13 on output.txt will produce the original data.
This program will use several C++ features. You'll need if..else or switch statements for the character substitutions (e.g. in the case the letter is 'A', substitute it with 'N'). You will need file input/output, and loops to read the characters.
Define at least one function in your program -- do not give me a giant main function. You should have at least one function that does the lookup for the substitution.
As an example, the message "HELLO WORLD!" gets encrypted to "URYYB JBEYQ!" and decrypted back to "HELLO WORLD!"
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