-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMain.java
More file actions
50 lines (40 loc) · 1.5 KB
/
Main.java
File metadata and controls
50 lines (40 loc) · 1.5 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
package com.mftplus.Tamrin.BankUml;
public class Main {
public static void main(String[] args) {
// New customer
Customer customer = new Customer("Shayan Aminaei");
customer.printCustomerInfo();
System.out.println();
// Making different accounts
Card card = new Card(customer);
Check check = new Check(customer);
Saving saving = new Saving(customer);
// Transations for each account
Transaction t1 = new Transaction();
Transaction t2 = new Transaction();
Transaction t3 = new Transaction();
card.addTransaction(t1);
check.addTransaction(t2);
saving.addTransaction(t3);
// Transactions
card.pay();
card.receipt();
System.out.println();
check.pay();
check.receipt();
System.out.println();
saving.pay();
saving.receipt();
System.out.println();
// Bank and branches Test
Bank bank = new Bank("National Bank");
Branch branch1 = new Branch("Branch no1 ", bank);
Branch branch2 = new Branch("Branch no2 ", bank);
bank.printBankInfo();
System.out.println();
// Transaction's test
System.out.println("Card transactions count: " + card.getTransactions().size());
System.out.println("Check transactions count: " + check.getTransactions().size());
System.out.println("Saving transactions count: " + saving.getTransactions().size());
}
}