-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
159 lines (132 loc) · 5.19 KB
/
main.cpp
File metadata and controls
159 lines (132 loc) · 5.19 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#include <iostream>
#include <string.h>
#include "people.h"
#include "cashier.h"
#include "accountant.h"
#include "manager.h"
#include "ceo.h"
#include "president.h"
#include "groups.h"
#include "seniorPartnerGroup.h"
#include "juniorPartnerEmployees.h"
#include "juniorEmployeeGroup.h"
#include "bank.h"
int main() {
cout << "Testing!" << endl;
int choice = 0;
cout << "1. Printing employee information." << endl;
cout << "2. Firing of employees and re-hiring them." << endl;
cout << "3. Opening and closing of bank accounts." << endl;
cout << "4. Withdrawing and depositing cash." << endl;
cout << "5. Conducting inter and outer bank transactions." << endl;
cout << "6. Requesting loans, repayment and account closure." << endl;
cout << "Enter choice: ";
cin >> choice;
if (choice > 6 || choice < 1) {
cout << "Choice not in valid range." << endl;
return 1;
}
cout << "Testing case: " << choice << endl;
Bank bank1("HSBC");
Bank bank2("QB");
Ceo ceo1("chriss", "pratt", 24);
Ceo ceo2("Harry", "Styles", 25);
President pr1("Tim", "Cook", 25);
President pr2("Jim", "Dawn", 26);
Manager m1("Manu", "ferris", 28);
Manager m2("Kim", "Player", 29);
Cashier csh1("Artur", "Godw", 27);
Cashier csh2("Lloyd", "Punj", 29);
Accountant actn1("Mike", "keaton", 26);
Accountant actn2("Panther", "Pink", 30);
bank1.addCeoToBank(ceo1);
//bank2.addCeoToBank(ceo1);
bank1.addManagerToBank(m1);
bank1.addPresidentToBank(pr1);
bank1.addAccountantToBank(actn1);
bank1.addCashierToBank(csh1);
bank2.addCashierToBank(csh1);
bank2.addAccountantToBank(actn2);
Client client1("Ninja");
Client client2("Lee");
switch (choice) {
case 1: {
bank2.printEmployeeInformation();
bank1.printEmployeeInformation();
break;
}
case 2: {
cout << "Before deletion!" << endl;
bank1.printEmployeeInformation();
//bank1.removeCeo(ceo1);
//bank1.removePresident(pr1);
bank1.removeManager(m1);
bank1.removeManager(m1);
//bank1.fireCashier(csh1);
//bank1.fireAccountant(actn1);
cout << "After deletion!" << endl;
bank1.printEmployeeInformation();
break;
}
case 3: {
bank1.openAccount(client1, 5555, 20000);
//bank1.openAccount(client1, 5555, 15000);
//bank1.openAccount(client1, 6464, 15000);
// bank2.openAccount(client1, 6464, 10000);
// bank1.openAccount(client2, 4545, 12000);
bank1.printClientInformation();
// bank2.printClientInformation();
// bank1.closeAccount(client1,5555);
bank1.closeAccount(client1, 5555);
// bank1.printClientInformation();
break;
}
case 4: {
bank1.openAccount(client1, 5555, 15000);
//bank1.openAccount(client1, 6969, 18000);
//bank1.depositCash(client1, 5555, 12000);
bank1.depositCash(client1, 5555, 2000);
// bank1.getAccountBalance(client1, 5555 );
//bank1.getAccountBalance(client1, 6969);
bank1.withdrawCash(client1, 5555, 100);
bank1.getAccountBalance(client1, 5555);
break;
}
case 5: {
cout << "!-------Inter Bank transfer simulation---------!" << endl;
//bank1.openAccount(client1, 4646, 12000);
// bank1.openAccount(client1, 4646, 12000);
bank1.openAccount(client1, 5454, 15000);
bank2.openAccount(client2, 4545, 15000);
// bank1.getAccountBalance(client2, 6565);
// bank1.getAccountBalance(client1, 4646);
// bank1.transferMoney(client1, 4646, 2000, client1, 4646);
//bank1.getAccountBalance(client1, 4646);
// bank1.getAccountBalance(client1, 4646);
cout << "!------------------------------------------------" << endl;
cout << "!-------Cross Bank transfer simulation---------!" << endl;
// bank2.getAccountBalance(client2, 4545);
bank1.crossBankTransfer(client1, 5454, 3000, client2, 4545, bank2);
bank2.getAccountBalance(client2, 4545);
bank1.getAccountBalance(client1, 5454);
cout << "!----------------------------------------------!" << endl;
break;
}
case 6: {
cout << "!---------Loan request simulation-----------!" << endl;
bank1.openAccount(client1, 4545, 12000);
bank1.requestForLoan(client1, 4545, 25000);
//bank1.repayLoan(client1, 4545, 15000);
// bank1.requestForLoan(client1, 4545, 25000);
//bank1.closeAccount(client1, 4545);
// bank1.repayLoan(client1, 4545, 10000);
bank1.getAccountBalance(client1, 4545);
// bank1.requestForLoan(client1, 4545, 2500);
bank1.repayLoan(client1, 4545, 25000);
bank1.closeAccount(client1, 4545);
bank1.printClientInformation();
cout <<"!--------------------------------------------!" << endl;
break;
}
}
}