Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.io.*;
- public class FileEncrypter {
- public static void main(String[] args) throws IOException
- {
- try
- {
- File myFile = new File("test.txt");
- Scanner input = new Scanner(myFile);
- PrintWriter writer = new PrintWriter("output.txt");
- while (input.hasNext())
- {
- String line = input.nextLine();
- char[] encrypt = line.toCharArray();
- for (int i = 0; i < encrypt.length; i++)
- {
- encrypt[i] += 10;
- writer.print(encrypt[i]);
- }
- writer.println();
- }
- writer.close();
- }
- catch (Exception e)
- {
- System.out.println("HE MAKES THE CATCH!");
- System.out.println(e.getMessage());
- System.out.println("EXIT CATCH");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement