-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
106 lines (104 loc) · 3.23 KB
/
main.cpp
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
#include "funcs.h"
int main() {
char ch;
int num;
intro();
system("clear");
int n = login();
if (n == -1) {
do {
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. NEW ACCOUNT";
cout<<"\n\n\t02. ALL ACCOUNT HOLDER LIST";
cout<<"\n\n\t03. BALANCE ENQUIRY";
cout<<"\n\n\t04. CLOSE AN ACCOUNT";
cout<<"\n\n\t05. MODIFY AN ACCOUNT";
cout<<"\n\n\t06. EXIT";
cout<<"\n\n\tSelect Your Option (1-6) ";
cin>>ch;
system("clear");
switch(ch) {
case '1':
write_account();
break;
case '2':
display_all();
break;
case '3':
cout<<"\n\ntEnter The account No. : "; cin>>num;
display_sp(num);
break;
case '4':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
delete_account(num);
break;
case '5':
cout<<"\n\n\tEnter The account No. : "; cin>>num;
modify_account(num);
break;
case '6':
cout<<"\n\n\tThanks for using bank managemnt system";
break;
default :cout<<"a";
}
cin.ignore();
cin.get();
} while(ch!='6');
return 0;
}
else if (n == 0) {
cout << "\nLogin Error";
return 0;
}
else {
do {
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. DEPOSIT AMOUNT";
cout<<"\n\n\t02. WITHDRAW AMOUNT";
cout<<"\n\n\t03. BALANCE ENQUIRY";
cout<<"\n\n\t04. MODIFY A PASSWORD";
cout<<"\n\n\t05. TRANSFER MONEY";
cout<<"\n\n\t06. EXIT";
cout<<"\n\n\tSelect Your Option (1-5) ";
cin>>ch;
system("clear");
switch(ch)
{
case '1':
deposit_withdraw(n, 1);
break;
case '2':
deposit_withdraw(n, 2);
break;
case '3':
display_sp(n);
break;
case '4':
modify_account(n,1);
break;
case '5':
cout << "\n\nEnter account number : ";
cin >> num;
cout << "\n\nEnter sum to transfer : ";
int sum;
cin >> sum;
if (check(n,sum)){
deposit_withdraw(n,2,sum);
deposit_withdraw(num,1,sum);
}
else{
cout << "Fail\n";
break;
}
break;
case '6':
cout<<"\n\n\tThanks for using bank managemnt system";
break;
default :cout<<"a";
}
cin.ignore();
cin.get();
}while(ch!='6');
return 0;
}
}