-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask1 .cpp
104 lines (86 loc) · 1.55 KB
/
task1 .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
#include<iostream>
#include<string>
#include<string.h>
using namespace std;
class band
{
protected:
int count;
//virtual void getcount()=0;
};
class metal:public band
{
private:
int pyrotec;
public:
void set_pyrotec(int a);
int get_pyrotec();
int get_members();
metal(int band_count,int no_pyrotech);
};
class symphony:public band
{
private:
int conductor;
int members;
public:
void set_conductor(int a);
int get_conductor();
int get_members();
int band_member();
symphony(int band_count,int no_condutor);
};
int symphony::get_members()
{
return(conductor+count);
}
int metal::get_members()
{
return (count+pyrotec);
}
int metal::get_pyrotec()
{
return pyrotec;
}
void metal::set_pyrotec(int a)
{
pyrotec=a;
}
metal::metal(int band_count,int no_pyrotech)
{
count=band_count;
pyrotec=no_pyrotech;
}
int symphony::get_conductor()
{
return conductor;
}
void symphony::set_conductor(int a)
{
conductor=a;
}
symphony::symphony(int band_count,int no_condutor)
{
count=band_count;
conductor=no_condutor;
}
int main (void)
{
cout<<"The band Member of symphony 10 and conductor are 1=";
symphony qw(10 ,1);
int a=qw.get_members();
cout<<a<<"\n";
qw.set_conductor(7);
cout<<"\nthe Conductor is set 7";
a=qw.get_members();
cout<< "\nthe new total member are ="<<a;
cout<<"\nThe band Member of metal 20 and conductor are 87=";
metal q(10 ,87);
a=q.get_members();
cout<<a<<"\n";
q.set_pyrotec(7);
cout<<"\nthe Conductor is set 7";
a=q.get_members();
cout<< "the new total member are ="<<a;
return 0;
}