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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

there's an extra u at the end of the encryption how would I make that a period

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education