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 #7 and #8 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 #7
import
java.io.*;
import java.util.scanner;
public class FileEncryptionFilterdemo
l
public static void main(string args[]) throws
IOException
(
// open a file to read
File file = new File("filel.txt");
Scanner inputFile = new scanner(file);
// open a file to write
Printwriter outputFile = new
PrintWriter("file2.txt");
//read lines from the file until no more are:
while (inputFile.hasNext())
(
// read the next line
String str = inputFile.nestLine();
for(int i =0; i str.length(); i++)
(
// get a character at a time
ohar ch = str.charAt (i);
// change the character into code
int code =(int)ch;
/* modify the code and change into
character */
ohar c =(ohax)(code +10);
/* print the modified code in the
output file */
outputFile.print (c);
import
java.io.*;
(
public static void main(String args[]) throws
IOException
{
// open a file to read
File file = new File("file2.txt");
scanner inputFile = new scanner(file);
// open a file to write
Printmriter outputFile = new
Printwriter("file3.tst");
//read lines from the file until no more are left
while (inputFile.hasNext ())
{
// read the next line
String str = inputFile.nextLine();
for(int i =0; i str.length(); i++)
{
// get a character at a time
char ch = str.charAt (i);
// change the character into code
int code =(int)ch;
/* modify the code and change into
character */
char c =(char)(code -10);
/* 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
Combine Programming Challenges # 7 and # 8 into

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!