-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
72 lines (68 loc) · 2.3 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
#include <iostream>
using namespace std;
int main()
{
int pin=4040,ch,balance=0,deposite,withdraw;
do
{
cout<<"*****************************************************\n";
cout<<"*****************************************************\n";
cout<<"****************WELCOME TO MY BANK*******************\n";
cout<<"*****************************************************\n";
cout<<"*****************************************************\n";
cout<<"\nPlease enter your pin number:\n";
cin>>pin;
if(pin==4040)
{
while(ch!=4)
{
cout<<"\n\n********************MENU********************\n" << endl;
cout<<" 1.DEPOSITE \n";
cout<<" 2.WITHDRAW \n";
cout<<" 3.BALANCE ENQUIRY \n";
cout<<" 4.EXIT \n\n\n";
cout<<"********************************************** \n";
cout<<"\nEnter your choice: \n";
cin>>ch;
if(ch>4)
{
cout<<"\n\n Invalid choice! ";
cout<<"\n Enter valid choice from 1-4 ";
}
else
{
switch (ch)
{
case 1:cout<<"Enter amount you want to deposite:\n";
cin>>deposite;
balance+=deposite;
cout<<"Your account balance is:"<<balance;
break;
case 2:cout<<"Enter amount to be withdraw:";
cin>>withdraw;
if(balance<withdraw)
{
cout<<"Insuufficient Balance!!!!!\n";
cout<<"please enter amount less than or equal to your balance amount.\n";
}
else
{
balance-=withdraw;
cout<<"Your account balance is:"<<balance;
break;
}
case 3: cout<<"Your account balance is:"<<balance;
break;
case 4:break;
}
}
}
}
else
{
cout<<"\n !!!! Wrong pin number !!!!";
cout<<"\n ******************* PLESE ENTER THE CORRECT PIN ****************\n\n";
}
}while(ch!=4);
return 0;
}