Write a program that allows users to encrypt and decrypt files. The file encrypt
ID: 3624839 • Letter: W
Question
Write a program that allows users to encrypt and decrypt files. The file encryption technique we will
use for this program is the highly secure “one letter off” system. So an “a” will be represented by a
“b”, and a “b” will be represented by a “c” in the encrypted file. (For simplicity’s sake, only
alphabetical characters will be encrypted. Punctuation and other symbols will be left intact.)
Prompt the user as to whether they would like to encrypt or decrypt the file. Then prompt the user for
the file name, and perform the encryption or decryption. Output the file to a new file named
“Encrypted.txt” or “Decrypted.txt”, depending on what the user has selected to do.
HINT: Using an ArrayList to store the letters of the alphabet may simplify both encrypting and
decrypting the file. In addition, using some of the other tools that we have picked up this semester
may also help, such as:
- Using multiple methods in a program
- For loops, and the String “charAt()” method
- The Character class, with methods like “isLetter()”
- ArrayList methods like “indexOf()”
Explanation / Answer
re posted
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.