Write a C++ program that reads text from a file and decodes the file by subtracting the position factor from the ASCII value of each character. Note that the Raptor program will encode the file and the C++ program will decode it.
See chapter 12 in Starting out with C++ for information on reading and writing to text files.
Your program should:
1. Read the text file one line at a time.
2. Change each character of the string by subtracting the position factor from it.
3. Write the encoded string to a second file, such as plain2.txt
Note that because there may be spaces in the encoded file, the getline function will work better than the >> operator.
Hint: In Visual C++ Express, put your plain.code file in the project directory. The same folder that your C++ source (.cpp) file is in.
Once your program executes correctly, upload your .cpp file only. Make sure your name is on the source code in a comment.

    • 12 years ago
    complete solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      main_file.cpp
    • attachment
      main.cpp