C++ Program (visual studio) Write a C++ program that reads text from a file and
ID: 3575121 • Letter: C
Question
C++ Program (visual studio)
Write a C++ program that reads text from a file and encrypts the file by adding 4 to the ASCII value of each character. This C++ 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 character of the string by adding 4 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 characters on the second line of the encoded file (spaces will now look like '$').
Sample of the input file:
Explanation / Answer
Solution:
Program to cipher text in c++
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.