Question: Write a C++ program that reads text from a file and encrypts the file by adding 4 to the ASCII value of each character. See

 Write a C++ program that reads text from a file and

Write a C++ program that reads text from a file and encrypts the file by adding 4 to the ASCII value of each character. See section 5.11 in Starting out with C++ for information on reading and writing to text files. Your program should: Read the provided plain.txt file one line at a time. Because this file has spaces, use getline (see section 3.8). Change each character of the string by adding 6 to it. Write the encoded string to a second file, such as coded.txt The encoded file should have the same structure as the original file, if the second line of the original file has 24 characters (including spaces) then there should be 24 characters on the second line of the encoded file (spaces will now look like '&')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!