You have been tasked to write a C++ program that will go through the first step of encrypting an input file and writing the encrypted contents to an output file. For each letter read in from the input file, add 3 letters to the value of the input letter. If the input letter is an A then the encrypted letter would be a D. If the input letter from the input file is an X then the encrypted letter would be an A. All spaces, digits, punctuation, and special characters do not need to be encrypted at this level. Simply write the space, punctuation, or special character to the output file as is. If a letter is uppercase in the input file, it should remain as an uppercase character in the output file. If a letter is lowercase in the input file, it should remain as a lowercase character in the output file. Since this program runs each month, the input file will be of various lengths; therefore, the program will read until end of file. The input file is found in the current directory and is named October6.txt. The output file will be written to the current directory and named EncryptOct6.txt. An example: If the contents of the input file is Live long and prosper. The output file would be: Olyh orqj dqg survshu. What the user should see when the program executes: When the program begins, the statement "Encryption Level 1" should be displayed. When the program opens the input file, the statement "Opening input file...." should be displayed. When the program begins reading through the input file encrypting the contents, the statement "Encrypting...." should be displayed. When the program closes the input and output files, the statement "Encryption complete." should be displayed. Encryption Level 1 Opening input file.... Encrypting.... Encryption complete. End of program. Contents of Oct6.txt: Live long and prosper. Contents of EncryptedOct6.txt: Olyh orqj dqg survshu.
You have been tasked to write a C++
For each letter read in from the input file, add 3 letters to the value of the input letter. If the input letter is an A then the encrypted letter would be a D. If the input letter from the input file is an X then the encrypted letter would be an A.
All spaces, digits, punctuation, and special characters do not need to be encrypted at this level. Simply write the space, punctuation, or special character to the output file as is.
If a letter is uppercase in the input file, it should remain as an uppercase character in the output file. If a letter is lowercase in the input file, it should remain as a lowercase character in the output file.
Since this program runs each month, the input file will be of various lengths; therefore, the program will read until end of file.
The input file is found in the current directory and is named October6.txt. The output file will be written to the current directory and named EncryptOct6.txt.
An example:
If the contents of the input file is
Live long and prosper. |
The output file would be:
Olyh orqj dqg survshu. |
What the user should see when the program executes:
When the program begins, the statement "Encryption Level 1" should be displayed.
When the program opens the input file, the statement "Opening input file...." should be displayed.
When the program begins reading through the input file encrypting the contents, the statement "Encrypting...." should be displayed.
When the program closes the input and output files, the statement "Encryption complete." should be displayed.
Encryption Level 1 Opening input file.... Encrypting.... Encryption complete. End of program. |
Contents of Oct6.txt: Live long and prosper.
Contents of EncryptedOct6.txt: Olyh orqj dqg survshu.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
there's an extra u at the end of the encryption how would I make that a period
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)