Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

void Encrypt(string source, string dest, ostream& log) Encrypts the file named s

ID: 3537955 • Letter: V

Question

void Encrypt(string source, string dest, ostream& log)


Encrypts the file named source. The result of the encryption is written to the file named dest. This function must open the source file and read in the characters one by one until the EOF is reached. One character at a time should be read from the source file and then written to the destination file in encrypted form. The encrypted character should be the original character but with 50 ADDED to its ASCII code value. A log message should be written to the log stream parameter. This function assumes that the log stream has already been opened.

Use the get function to read in a character in order to preserve the newline characters.

void Decrypt(string source, string dest, ostream& log)

Decrypts the file named source. The result of the decryption is written to the file named dest. This operates similar to the Encrypt function except it SUBTRACTS 50 from the ASCII code value of the read in character. A log message should be written to the log stream parameter. This function assumes that the log stream has already been opened.

Use the get function to read in a character in order to preserve the newline characters.

void View(string source, ostream& log)


Prints the contents of the file named source on the screen. A log message should be written to the log stream parameter. This function assumes that the log stream has already been opened.

Use the get function to read in a character in order to preserve the newline characters.

Explanation / Answer

Find code here - http://pastebin.com/FK83GvC1