-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpg3.cpp
More file actions
112 lines (94 loc) · 1.29 KB
/
pg3.cpp
File metadata and controls
112 lines (94 loc) · 1.29 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
#include<iostream>
using namespace std;
class account
{
public:
string cname;
char type;
int acno;
};
class curac:public account
{
public:
int bal=0;
int inte=1;
int minbal=100;
void deposit(int x)
{
bal=bal+x;
}
void display()
{
cout<<"name"<<cname<<"\n"<<"type"<<type<<"acno"<<acno<<"\n";
cout<<"the balence is"<<bal<<"\n";
}
void with(int z)
{
if(bal<minbal)
{
cout<<"not permitted bal is"<<bal<<"\n";
}
else
{
bal=bal-z;
}
}
void penal()
{
if(bal<minbal)
{
bal=bal-23;
cout<<bal;
}
}
};
class savac:public account
{
public:
int bal=0;
int inte=1;
int minbal=100;
void deposit(int x)
{
bal=bal+x;
}
void display()
{
cout<<"name"<<cname<<"\n"<<"type"<<type<<"acno"<<acno<<"\n";
cout<<"the balence is"<<bal;
}
void with(int z)
{
bal=bal-z;
cout<<"balance after withdrawaal"<<bal<<"\n";
}
void intere()
{
inte=bal/20;
bal=bal+inte;
cout<<"interest is"<<inte<<"\n";
}
};
int main()
{
curac a;
a.cname="debayan";
a.type='c';
a.acno=1000;
a.deposit(200);
a.with(100);
a.with(10);
a.penal();
a.display();
savac b;
b.cname="deb";
b.type='s';
b.acno=1000;
b.deposit(200);
b.with(100);
b.with(10);
//b.penal();
b.intere();
b.display();
return 0;
}