-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproj.cpp
130 lines (113 loc) · 2.51 KB
/
proj.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
#include<conio.h>
#include<iostream>
using namespace std;
int er=6000;
class Account{
private:
friend class admin;
int acc_NUM; string name,fat_nam;
string pass;
protected:
void add_ac(){
cout<<"Enter the name:-";cin>>name;
cout<<name<<" father name:-"; cin>>fat_nam;
cout<<"Unique Number y/n:-"; char ch; cin>>ch;
switch(ch){
case 'y':
cout<<"Enter the unique acc number"; cin>>acc_NUM;
break;
case 'n':
er=er+1; acc_NUM=er;
cout<<"\tAutomatcally account number has been genrated\5\n\t\t AC/No# "<<acc_NUM<<" Password has been set\3\n";
pass="hama";
break;
default:
cout<<"Agin repeat the process.";}
system("pause");
system("cls");
cout<<"Name:-"<<name<<"\nAccount Number:-"<<acc_NUM<<"\nFather name:-"<<fat_nam<<endl;
}
void show(){
cout<<"Name:-"<<name<<"\nAccount Number:-"<<acc_NUM<<"\nFather name:-"<<fat_nam<<endl;
}
int ac_check(){
return acc_NUM;
}
string ac_pass(){
return pass;
}
void ac_pass2(string gh){
pass=gh;
}
};
class Money{
private:
int rupess;
public:
void Tra1(){
int tra;
cout<<"Enter Ammount to transaction:-"; cin>>tra;
rupess=rupess-tra;
cout<<"Transaction has been sucessfull"<<endl;
}
void add1(){
cout<<"Enter the rupess:-";cin>>rupess;
}
void show_mo1(){
cout<<"Your total money is"<<rupess<<endl;
}
};
class Tr:public Money{
public:
void Tra(){
Money::Tra1();
}
};
class Dep:public Money{
public :
void add(){
Money::add1();
}
};
class Show_mo:public Money{
public:
void show_mo(){
Money::show_mo1();
}
};
class AD:public Tr,public Show_mo,public Dep{
};
class user:public Account,public Money{
};
class admin:public user{
private:
user check;
public:
void ad(){
check.add_ac();
}
void sh(){
check.show();
}
void ac_ps2(string hj){
check.ac_pass2(hj);
}
int ac_ch(){
return check.ac_check();}
string ac_pa(){
return check.ac_pass();
}
};
int main(){
admin d[50]; string id;
int nu=0;
while(1){
cout<<"Enter your identity:-"; cin>>id;
if(id=="admin")
{ string ps="admin"; cout<<"Enter your password:-"; cin>>id;
if(id=="admin"){
int wh_cr=1,chi=0;
while(chi!=3){
cout<<"1)Create account:-\n2)Display All Accounts Information\n3)Exit\n Enter:-";cin>>chi;
switch(chi){
case 1: