-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtm_Simulation.java
More file actions
38 lines (34 loc) · 985 Bytes
/
Copy pathAtm_Simulation.java
File metadata and controls
38 lines (34 loc) · 985 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
29
30
31
32
33
34
35
36
37
38
import java.io.File;
import java.io.Writer;
import java.io.IOException;
import java.util.*;
class Customer{
String id;
private double[] fileopen() {
this.id += ".txt";
try {
File myfile = new File(this.id);
if(!myfile.exists()){
return null;
}
Scanner sc1 = new Scanner(myfile);
String line = sc1.nextLine();
String data[] = line.split(",");
double result[] = new double[3];
result[0] = Integer.parseInt(data[0]);
result[1] = Double.parseDouble(data[1]);
result[2] = Integer.parseInt(data[2]);
sc1.close();
return result;
}
catch(Exception e){
System.out.println("Error: " + e);
return null;
}
}
private void fileclose(){
this.id += ".txt";
}
}
public class Atm_Simulation {
}