-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
23 lines (22 loc) · 847 Bytes
/
Tester.java
File metadata and controls
23 lines (22 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.BufferedReader;
import java.io.FileReader;
public class Tester {
public static void main(String[] args) throws Exception
{
ATM b = new ATM();
b.openAccount("user1", 1000.0);
b.openAccount("user2", 250.0);
System.out.println(b.checkBalance("user1"));
System.out.println(b.checkBalance("user2"));
b.transferMoney("user1", "user2", 50.0);
System.out.println(b.checkBalance("user1")); //950
System.out.println(b.checkBalance("user2")); //300
BufferedReader br = new BufferedReader(new FileReader("AccountAudit.txt"));
b.audit();
if (br.readLine().equals ("UserID: user1; Amount: 950.0") && br.readLine().equals("UserID: user2; Amount: 300.0"))
{
System.out.println("Audit works");
}
br.close();
}
}