I have to do a project for school decripting a txt.file that says "!nraB ehT nO nwoD gniraeB sretsaoT ,yadyaM ,yadyaM"
i Get how to reverse the file but this is new to me i hope you guys can help and im not of bothersome.
Decryption stage 2:
The structure of this program is similar to stage 1; you will open the file “stage2.txt” and read the sentence into a string.
You will send the string to a function you write named “normalize_sentence”:
string normalize_sentence(string s);
This function will down case all letters of the string (that is, make all letters lower-case), and then up case only the first character of the string. It will then return the modified string.
You must use one of the STL algorithms.
Write out the normalized string to a new file called “stage3.txt”.
Decryption stage 3:
The structure of this program is similar to stage 2; you will open the file “stage3.txt” and read the sentence into a string.
You will send the string to a function called “replace_sentence”:
string replace_sentence(string s);
This function will replace certain words in the string with other words. You will then return the modified string.
You must use string functions.
USE IF-STATEMENTS TO DO THE SUBSTITUTIONS. DO NOT USE A SWITCH-STATEMENT IN THIS FUNCTION!!!
Here are the words that need to be replaced. Each may appear one time in each string.
Replace “barn” with “Galactica”
Replace “toaster” with “Cylon”
You must replace the entire string if you find these phrases
After you finish write out the string to a new file named “decrypted.txt”.