Write a program that will read the file text.txt which is provided and the encrypted message in there. Please write back the decrypted message into the output.txt file. When you see the message in the output.txt file, you need to submit the java code file. You need to use Rot13 class for decrypting the message.
Write a
message in there. Please write back the decrypted message into the output.txt file.
When you see the message in the output.txt file, you need to submit the java code
file. You need to use Rot13 class for decrypting the message.
Do not need to submit in the output.txt file.
file example:
public class FileExample {
public static void main(String[]args){
try {
//create file object for input.txt
File in_file = new File("src/input.txt");
//create file object for output.txt
File out_file = new File("src/output.txt");
//read the input.txt file with Scanner
Scanner read = new Scanner(in_file);
//write the output.txt file with PrintWriter
PrintWriter w = new PrintWriter(out_file);
while(read.hasNextLine()){
w.write(read.nextLine());
}
//don't forget to close
w.close();
// while(scan.hasNext()){
// System.out.println(scan.next());
// }
}catch(Exception ex){
ex.getStackTrace();
}

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images









