Repository navigation
Expand file tree
/
Copy pathYT_Channel_Management.cpp
More file actions
96 lines (78 loc) · 1.69 KB
/
Copy pathYT_Channel_Management.cpp
File metadata and controls
96 lines (78 loc) · 1.69 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
#include<iostream>
#include<list>
using namespace std;
class YoutubeChannel{
private:
string Name;
int SubsCount;
list<string>PubVids;
protected:
string OwnerName;
public:
YoutubeChannel(string name, string ownername)
{
Name = name;
OwnerName = ownername;
SubsCount = 0;
}
void Subscribe()
{
SubsCount++;
}
void Unsubscribe()
{
if(SubsCount>0)
SubsCount--;
}
void PubVideo(string title)
{
PubVids.push_back(title);
}
void getInfo()
{
cout<<"Name: "<<Name<<endl;
cout<<"Owner Name: "<<OwnerName<<endl;
cout<<"Subs Count: "<<SubsCount<<endl;
//cout<<"Published Video Titles: "<<yt.PubVids<<endl; (error)
cout<<"Videos: "<<endl;
for(string vid: PubVids)
{
cout<<vid<<endl;
}
cout<<endl;
}
};
class CookingYoutubeChannel: public YoutubeChannel{
public:
CookingYoutubeChannel(string name, string ownername): YoutubeChannel(name, ownername)
{
}
void practice()
{
cout<<OwnerName<<" is practicing cooking, learning new recipes and experimenting with spices"<<endl;
cout<<endl;
}
};
int main()
{
YoutubeChannel yt("Nova","Yunus");
yt.PubVideo("\tAces United lineup");
yt.PubVideo("\tA Versus Video");
yt.Subscribe();
yt.getInfo();
CookingYoutubeChannel cookingyt("PeaCooks","Adam");
cookingyt.PubVideo("\tMaking Pasta");
cookingyt.PubVideo("\tMaking Sandwiches");
cookingyt.PubVideo("\tMaking EggRolls");
cookingyt.Subscribe();
cookingyt.Subscribe();
cookingyt.getInfo();
cookingyt.practice();
CookingYoutubeChannel cookingyt2("Foodiemad","James");
cookingyt.PubVideo("\tMaking Cheesecake");
cookingyt.PubVideo("\tMaking Pizza");
cookingyt.PubVideo("\tMaking Salad");
cookingyt2.getInfo();
cookingyt2.practice();
return 0;
}