Write a C++ program that reads text from a file and encrypts the file by adding an encryption factor (EF) to the ASCII value of each character.

© 2017 -2020 Paul Koester, Tarrant County College Lab #10 C++ Write a C++ program that reads text from a file and encrypts the file by adding an encryption fact or (EF) to the ASCII value of each character. The encryption factor is 1 for the first line and increases by 1 for each line up to 4 and then starts over at 1. So , for the 4th line the EF is 4, for the 5 th line it is 1, for the 10 th line it is 2. In General , for the Nth line , the encryption factor is (N -1) % 4 + 1. If the sevent h line of the input file is , “This is the seventh line of the file. ” The seventh line of the encrypted file would have 3 added to each character . It would look like , “Wklv#lv#wkh#vhyhqwk#olqh#ri#wkh#iloh1 ” See section 5.11 and sect ions 12 .3-5 in Starting out with C++ for information on reading and writing to text files. Your program should: 1. Read the provided plain.txt file one line at a time. Because this file has spaces, use getline (see section 3.8). 2. Change each characte r of the string by adding the encryption factor to it . 3. Write the encoded string to a second file, such as coded .txt 4. 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 character s on the second line of the encoded fi le (spaces will n ow be repla ced by the characters !, ”, #, and $). Hints: 1. In Visual Studio Express, put your plain.txt file in the project directory. The same folder that your C++ source (.cpp) file is in. 2. One of the challenges is to keep reading l ines from the plain.txt file until the end. Program 12 -8 is an example of how to do that. Once your program executes correctly, upload your .cpp file only. Make sure your name is in the source code in a comment. Feel free to write a program that de codes this encrypted file for your own amusement.