Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been tasked to a Java program that will go through the first step of encrypting an input file and writing the encrypted contents

You have been tasked to a Java 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 a letter is uppercase in the input file, the encrypted letter should be converted to a lowercase character in the output file. If a letter is lowercase in the input file, the encrypted letter should be converted to an uppercase character in the output file. This means if the input letter is an A then the encrypted letter would be the letter d. If the input letter from the input file is an X then the encrypted letter would be the letter 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.

Since the input file will be of various lengths, the program will read until end of file.

The input file should be located in the current directory and is named Oct1.txt. The output file will be written to the current directory and named EncryptOct1.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.

To Do:

  1. Zip the contents of your project folder.
  2. Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly how your program will be graded.
  3. Check the Calendar for the due date!
  4. Upload your .zip file into the project dropbox on or before the due date.

Item

Output is attractive with appropriate white space

Template code used in .cpp file

Program commented appropriately

Program executes without errors

Program opens and reads the Oct1.txt file from the current directory. Program opens and writes to the EncryptedOct1.txt file from the current directory.
Program reads the contents of the input file until the end of file. Program writes the encrypted contents to the output file.
* Every uppercase letter in the input file is lowercase in the output file * Every lowercase letter in the input file is uppercase in the output file * Every letter is encrypted by moving 3 letters forward. (A = d, z = C, etc...) * Spaces, digits, special characters, and punctuation are not encrypted and are written to the output file as is and in the correct sequence.
* 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.
An opening and closing statement is displayed appropriately.
Zip file is uploaded properly

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions