-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM.java
More file actions
77 lines (56 loc) · 2.39 KB
/
ATM.java
File metadata and controls
77 lines (56 loc) · 2.39 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
@author Emre Eldemir
@version JDK 17
*/
public class ATM {
public static void main(String[] args) {
/*
---Test Codes---
Bank b = new Bank("My Bank", "My Bank's Address");
b.addCompany(1, "Company 1");
b.getCompany(1).openAccount("1234", 0.05);
b.addAccount(b.getCompany(1).getAccount("1234"));
b.getAccount("1234").deposit(500000);
b.getCompany(1).getAccount("1234").deposit(500000);
b.getCompany(1).openAccount("1235", 0.03);
b.addAccount(b.getCompany(1).getAccount("1235"));
b.getCompany(1).getAccount("1235").deposit(25000);
b.addCompany(2, "Company 2");
b.getCompany(2).openAccount("2345", 0.03);
b.addAccount(b.getCompany(2).getAccount("2345"));
b.getCompany(2).getAccount("2345").deposit(350);
b.addCustomer(1, "Customer" ,"1");
b.addCustomer(2, "Customer", "2");
Customer c = b.getCustomer(1);
c.openAccount("3456");
c.openAccount("3457");
c.getAccount("3456").deposit(150);
c.getAccount("3457").deposit(250);
c = b.getCustomer(2);
c.openAccount("4567");
c.getAccount("4567").deposit(1000);
b.addAccount(c.getAccount("4567"));
c = b.getCustomer(1);
b.addAccount(c.getAccount("3456"));
b.addAccount(c.getAccount("3457"));
Collection collections = new ArrayList();
collections.add(new Transaction(3,"3456",500));
collections.add(new Transaction(1,"4567",500));
collections.add(new Transaction(2,"1235","3456",100));
collections.add(new Transaction(3,"3456",500));
collections.add(new Transaction(1,"4567",500));
collections.add(new Transaction(2,"4567","3456",100));
collections.add(new Transaction(3,"1235",500));
collections.add(new Transaction(1,"3456",500));
collections.add(new Transaction(2,"4567","3456",100));
collections.add(new Transaction(3,"1235",500));
collections.add(new Transaction(1,"4567",500));
collections.add(new Transaction(2,"4567","1235",100));
collections.add(new Transaction(3,"3456",500));
collections.add(new Transaction(1,"4567",500));
collections.add(new Transaction(2,"1235","3456",100));
b.processTransactions(collections,"outFile.txt");
System.out.println(b);
*/
}
}