Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Source photo: Starting Out with Java From Control Structures through Objects 5th Edition. Tony Gaddis. Page 753. I saw this same problem that was posted

image text in transcribed Source photo: Starting Out with Java From Control Structures through Objects 5th Edition. Tony Gaddis. Page 753.

I saw this same problem that was posted (https://www.chegg.com/homework-help/Starting-Out-with-Java-6th-edition-chapter-11-problem-7PC-solution-9780133957235), but when I tried it, it was not working for me and I don't know why.

image text in transcribed

7. File Encryption Filter File encryption is the science of writing the contents of a file in a secret code. Your encryp- tion program should work like a filter, reading the contents of one file, modifying the data into a code, and then writing the coded contents out to a second file. The second file will be a version of the first file, but written in a secret code. Although there are complex encryption techniques, you should come up with a simple one of your own. For example, you could read the firs file one character at a time, and add 10 to the character code of each character before it is written to the second file. D FileEncryptionFilterjava 1 import java.io.*; 2 import java.util.Scanner; 3 public class FileEncryptionFilter 4 ublic static void main(String[] args) throws IOException File file-new File("Lorem_Ipsum.txt"); Scanner inputfilenew Scanner(file); 7 PrintWriter outputfile new Printwriter("Lorem_Ipsum2.txt"); 10 while(inputfile.hasNext)) 12 13 14 15 16 17 18 19 20 21 string str = inputfile.next Line(); for(int i e; i FileEncryptionFilter [Java Application] C: Program FilesJavajre-10.0.1\binavaw.exe (Mar 11, 2019, 2:56:44 AM) Exception in thread "main"java.io.FileNotFoundException: Lorem Ipsum.txt (The system cannot find the file specified) at java.base/java.io.FileInputStream.opene (Native Method) at java.base/java.io.FileInputStream.open (Unknown Source) at java.base/java.io.FileInputStream. (Unknown Source) at java.base/java.util.Scanner.

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

More Books

Students also viewed these Databases questions