-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBank_Management_project.cpp
More file actions
120 lines (98 loc) · 2.86 KB
/
Bank_Management_project.cpp
File metadata and controls
120 lines (98 loc) · 2.86 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
//THIS IS A BANK MANAGEMENT PROJECT ,WHERE YOU ARE ABLE TO CREATE YOUR ACCOUNT ,DEPOSIT AND WIDHRAW MONEY . //
#include<bits/stdc++.h>
using namespace std;
class bank
{
private:
char name[100];
char add[100];
char acc;
int amount;
public:
void create_account();
void deposit_amount();
void widhraw_amount();
void display_account();
};
void bank :: create_account()
{
cout<<"\n\n------------------CREATE ACCOUNT------------------\n";
cout<<"Enter the name of person :: ";
cin.ignore();
cin.getline(name,100);
cout<<"Enter the address of the person :: ";
cin.ignore();
cin.getline(add,100);
cout<<"Enter which type of bank account you want to open (s/c) :: ";
cin>>acc;
cout<<"Enter the amount :: ";
cin>>amount;
cout<<"------------------SUCCESSFULLY OPENED------------------\n";
}
void bank :: deposit_amount()
{
cout<<"\n\n------------------DEPOSIT AMOUNT ------------------\n";
int balance ;
cout<<"Enter the amount do you want to deposit :: ";
cin>>balance;
amount += balance ;
cout<<"Your total bank amount :: "<<amount;
cout<<"\n------------------SUCCESSFULLY DEPOSITED------------------\n";
}
void bank :: widhraw_amount()
{
cout<<"\n\n------------------WIDHRAW AMOUNT ------------------\n";
cout<<"Enter the amount which you want to widhraw :: ";
float wid;
cin>>wid;
amount -= wid;
cout<<"Your remaining bank amount :: "<<amount;
cout<<"\n------------------SUCCESSFULLY WIDHRAW------------------\n";
}
void bank :: display_account()
{
cout<<"\n\n------------------DISPLAY ACCOUNT------------------\n";
cout<<"Account holder :: "<<name<<endl;
cout<<"Address :: "<<add<<endl;
cout<<"Account type :: "<<acc<<endl;
cout<<"Amount :: "<<amount;
cout<<"\n------------------SUCCESSFULLY DISPLAYED------------------\n";
}
int main()
{ char x;
bank enquiry;
do{
int ch;
cout<<"1) CREATE BANK ACCOUNT\n";
cout<<"2) DEPOSIT AMOUNT IN ACCOUNT\n";
cout<<"3) WIDHRAW AMOUNT IN ACCOUNT\n";
cout<<"4) DISPLAY ACCOUNT DETAILS\n";
cout<<"5) EXIT\n";
cout<<"Enter your choice :: ";
cin>>ch;
switch(ch){
case 1:
enquiry.create_account();
break;
case 2:
enquiry.deposit_amount();
break;
case 3:
enquiry.widhraw_amount();
break;
case 4:
enquiry.display_account();
break;
case 5:
exit(1);
break;
default:
cout<<"INVALID CHOICE\n";
}
cout<<"\nDo you want to do other operations yes(y)/no(n) :: ";
cin>>x;
if(x == 'n' || x == 'N')
exit(0);
}while(x == 'y' || x == 'Y');
return 0;
}