Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

my code doesn't work: void rot13 (char *s) { if (s == NULL) return; int i; for (i = 0; s[i]; i++) { if (s[i]

image text in transcribed

my code doesn't work:

void rot13 (char *s) { if (s == NULL) return; int i; for (i = 0; s[i]; i++) { if (s[i] >= 'a' && s[i] = 'A' && s[i] = 'n' && s[i] = 'N' && s[i]  

ROT13 (rotate by 13 places) is a simple letter substitution cipher that is an instance of a Caesar cipher developed in ancient Rome and used by Julius Caesar who used it in his private correspondence. ROT13 replaces a letter with the letter 13 letters after it in the alphabet. The following table demonstrates the translation in ROT 13 Thus, the translation of the word JULIUS using ROT13 would be WHYVHF. Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your main function should be responsible for reading the input file and coordinating calls to a value returning function named Rot13 that will do the translation for each character and Write TranslatedChar that will write the translated character to a secondary file. The Rot13 function takes as input the character to be translated and returns the translated character. The second function named Write TranslatedCharwll have two parameters, the translated character and a reference to an ifstream data type for a secondary file named "output.rot13", and write that translated character to this file

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

Students also viewed these Databases questions

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago