Question: Combine Programming Challenges # 7 and # 8 into one program. Encrypt a file, then decrypt the file. Take a simple text file and encrypt
Combine Programming Challenges # and # into one program. Encrypt a file, then decrypt the file. Take a simple text file and encrypt it Then take the encrypted file and decrypt it Submit your combined program's java source file.
I have provided the code for Programming Challenge below and need help combining them please.
Programing challenge #
import
java.io;
import java.util.scanner;
public class FileEncryptionFilterdemo
l
public static void mainstring args throws
IOException
open a file to read
File file new Filefileltxt;
Scanner inputFile new scannerfile;
open a file to write
Printwriter outputFile new
PrintWriterfiletxt;
read lines from the file until no more are:
while inputFilehasNext
read the next line
String str inputFile.nestLine;
forint i ; i strlength; i
get a character at a time
ohar ch strcharAt i;
change the character into code
int code intch;
modify the code and change into
character
ohar c ohaxcode ;
print the modified code in the
output file
outputFile.print c;
import
java.io;
public static void mainString args throws
IOException
open a file to read
File file new Filefiletxt;
scanner inputFile new scannerfile;
open a file to write
Printmriter outputFile new
Printwriterfiletst;
read lines from the file until no more are left
while inputFilehasNext
read the next line
String str inputFile.nextLine;
forint i ; i strlength; i
get a character at a time
char ch strcharAt i;
change the character into code
int code intch;
modify the code and change into
character
char c charcode ;
print the modified code in the
output file
outputFile.print c;
outputEile.println;
inputFile.close;
outputFile.println;
outputEile.close;
inputese two files
urile.close
outputEile.close
end of main method
end of main method
end of EileDecriptionFilderDemo class
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
