Question: Using constructs from this chapter or earlier, combine Programming Challenges # 7 and # 8 on page 7 5 6 into one program. Encrypt a

Using constructs from this chapter or earlier, combine Programming Challenges #7 and #8 on page 756 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.
You also need to include at least one screenshot of the results. Your screenshot needs to display your name somewhere in the results.
Avoid poor programming practices in your assignments. Many web sites contain programs that are poorly written. The text contains many examples of programs that use good programming practices. Use the text as a guide.
You should have comments in your program to explain what your program is doing. They should be meaningful comments. I will deduct points if you dont have comments.
You should have only one exit point from your program and any methods. (Do not have multiple return statements). I may deduct points if you have multiple exit points.
Do not use the word "invalid" in any user message as it has multiple meanings. I will deduct points if you use invalid.
You should use appropriate and meaningful variable names. I will deduct points if you use single letter variable names or names that dont reflect the usage of the variable.
Do not use break, continue, or intentional infinite loops (while true) in your program to alter the program flow. Fix your logic. I will deduct points if you do.
You should use appropriate user prompts. They should be simple, accurate, have good grammar, and not have any misspellings. I may deduct points if you have confusing prompts.
You should properly label and format output or results. It should be obvious what your results mean. I will deduct points if your output or results are confusing or not formatted as they should be (for example, currency should either have 0 or 2 decimal places).
Each assignment starts with the words "using constructs from this chapter or earlier." You can only use concepts from the chapter the assignment is from, or previous chapters. I will deduct points if you use things we haven't covered or are not in the text.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
Using constructs from this chapter or earlier,

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!