-
Notifications
You must be signed in to change notification settings - Fork 0
/
atm.cpp
171 lines (120 loc) · 3.42 KB
/
atm.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
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
160
161
162
163
164
165
166
167
168
169
170
171
#include <iostream>
using namespace std;
int main()
{
int opcode, amt, dep, pass, bank;
int bill;
int transfer, actype, samt;
int mybal = 1000;
cout << "\t WELCOME TO ABIOLA ATM MACHINE\n";
cout << "\t Please insert your atm card\n";
cout << "\t Enter your password: ";cin >> pass;
if (pass == 1234)
{
//if (pass == 1234)
cout << string(2, '\n');
cout<< " \tPlease input\n";
cout<<" \t 1 - inquiry\n";
cout <<"\t 2 - paybill \n";
cout << "\t 3 - Transfer \n";
cout<< " \t 4 - Withdraw \n";
cout<< " \t 5 - deposit \n";
cout << "\t 6 - exit\n";
cin >> opcode, amt;
switch (opcode)
{
case 1: cout << "\t Your balance is = " << mybal;
break;
case 2: cout << "\t Indicate Bill type";
break;
cout << "\t\n Please input \n";
cout<< "\t 1 - NEPA \n";
cout << "\t 2 - Hospital Bill";
cout << "\t\n 3 - DSTV\n";
switch (bill)
{
case 1: cout <<"Your NEPA BILL Payment was succesful";
break;
case 2: cout <<" You Hospital Bill payment was successful";
break;
case 3: cout<< " Your DSTV payment was successful";
break;
}
case 3: cout << "\t Specify destination bank\n";
cout <<"\t Please Input \n";
cout <<"\t 1 - First Bank\n";
cout <<"\t 2 - Access Bank\n";
cout <<"\t 3 - Zeneth Bank \n";
cout <<"\t 5 - GTB \n";
cout <<"\t 6 - Eco Bank \n";
cout <<"\t 7 - Union Bank\n";
cin >> bank;
switch (bank)
{
case 1: cout <<"\t\n Specify First Bank Account type\n";
cout << "\t \n Please input\n";
cout << "\t\n 1 - Saving\n";
cout << "\t\n 2 - Current \n";
cout << "\t\n 3 - Fixed \n";
cin >> actype;
//cout << "\n\t Specify Amount \n";
//cin >> samt;
//cout << samt << "was transfered to Mr. Abiola Gbode succeefully";
switch (actype)
{
case 1: cout << "\n\t Specify Amount\n";
cin>> samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
case 2: cout << "\n\t Specify Amount\n";
cout<< samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
case 3: cout << "\n\t Specify Amount\n";
cout<< samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
}
case 2: cout <<"\t\n Specify Access Bank Account type\n";
cout << "\t \n Please input\n";
cout << "\t\n 1 - Saving\n";
cout << "\t\n 2 - Current \n";
cout << "\t\n 3 - Fixed \n";
break;
switch (actype)
{
case 1: cout << "\n\t Specify Amount\n";
cout<< samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
case 2: cout << "\n\t Specify Amount\n";
cout<< samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
case 3: cout << "\n\t Specify Amount\n";
cout<< samt;
cout << samt << " was transfered to Mr. Abiola Gbode Successfully";
break;
}
}
case 4: cout << "\t Input amt to withdraw: ";
cin >> amt;
mybal = mybal - amt;
cout << "\t \n your remaining balance: "<< mybal;
break;
case 5: cout << "\t Input amount deposited: ";
cin >> dep;
mybal = mybal + dep;
break;
case 6: cout << "\t Are you sure";
break;
}
}
else
{
cout << "Invalid Pin";
}
}
}
return 0;
}