- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCypher.java
More file actions
Latest commit
28 lines (27 loc) · 865 Bytes
/
Copy pathCypher.java
File metadata and controls
28 lines (27 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
importjava.util.*;
importjava.io.*;
classCypher {
publicstaticvoidmain(Stringargs[]) {
try {
Stringn;
charc;
inti;
Scannerscan = newScanner(System.in);
System.out.println("Enter file name:");
n = scan.nextLine();
FileReaderfin = newFileReader("input.txt");
FileWriterfout = newFileWriter(n);
while ((i = fin.read()) != -1) {
c = (char) i;
System.out.println(c);
fout.write(i + 3);
}
fin.close();
fout.close();
} catch (FileNotFoundExceptione) {
System.out.println("Caught Exception" + e);
} catch (IOExceptione) {
System.out.println("Caught Exception" + e);
}
}
}