-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio.java
More file actions
47 lines (45 loc) · 1.51 KB
/
io.java
File metadata and controls
47 lines (45 loc) · 1.51 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.util.*;
import java.io.*;
public class io {
public static void Clear() {
try {
FileWriter fwOb = new FileWriter("Results.txt", false);
PrintWriter pwOb = new PrintWriter(fwOb, false);
pwOb.flush();
pwOb.close();
fwOb.close();
} catch (IOException e) {
}
}
public static String input(){
Scanner myObj = new Scanner(System.in);
String Filenames = myObj.nextLine();
myObj.close();
return Filenames;
}
public static void PrintStats(String filename, int Stats[]) {
try {
FileWriter fWriter = new FileWriter("Results.txt", true);
BufferedWriter br1 = new BufferedWriter(fWriter);
int i = 0;
br1.write(filename);
br1.newLine();
br1.write(" Hits Miss");
br1.newLine();
br1.newLine();
br1.write("L1 " + Stats[i++] + " " + Stats[i++]);
br1.newLine();
br1.write("L2 " + Stats[i++] + " " + Stats[i++]);
br1.newLine();
br1.write("L2 Partial " + Stats[i] + " N.A");
br1.newLine();
br1.newLine();
br1.newLine();
br1.newLine();
br1.newLine();
br1.close();
} catch (IOException e) {
System.out.println(e);
}
}
}