-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathflix
More file actions
193 lines (173 loc) · 3.14 KB
/
Copy pathflix
File metadata and controls
193 lines (173 loc) · 3.14 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#include<iostream>
#include"string"
using namespace std;
class title
{
private:
string serial;
public:
title()
{
}
~title()
{
}
void input();
void output();
};
class netflix
{
private:
int charges;
int detail;
title title[5];
public:
netflix()
{
}
~netflix()
{
charges = 0;
detail =0;
}
void amount();
void details();
void inputs();
void outputs();
};
class user
{
private:
netflix n;
public:
user()
{
}
~user()
{
}
void getamount();
void getdetail();
void inputtile();
void outputtitle();
void gettitle();
void deac();
};
void title::input()
{
cin>> this->serial;
}
void title::output()
{
cout << this->serial <<endl;
}
void netflix::inputs()
{
cout<< "title" << endl;
for (int i = 0; i<5; i++)
{
title[i].input();
}
}
void netflix::outputs()
{
cout<< "title" << endl;
for (int i = 0; i<5; i++)
{
title[i].input();
}
}
void netflix::amount()
{
cout << "1000 subscription charges" << endl;
cout << "enter amount to create your account" << endl;
cin >> this ->charges;
cout << this->charges;
if (this ->charges ==1000)
{
cout << " Your account is activated" << endl;
cout << " You have 5 hours of streaming limit" << endl;
}
}
void netflix::details()
{
int n;
int m= 5;
int i;
cout << " HOW MANY serials you watched" << endl;
cout << " 1 serial = 1Hrs" <<endl;
cin>> n;
i = m-n;
cout << " Your remaning duration" <<" " << i << "Hr" << endl;
if (i==0)
{
cout << " Your account is deactivated" << endl;
}
}
void user::getamount()
{
n.amount();
}
void user::getdetail()
{
n.details();
}
void user::inputtile()
{
n.inputs();
}
void user::gettitle()
{
n.outputs();
}
void user::deac()
{
cout << " Your account is deactivated" << endl;
}
// now we want to give the main
int main(int argc,char *argv[])
{
user u;
char ch;
cout << "******************************" << endl;
cout << " Welcome To Netflix" <<endl;
cout << "******************************" <<endl;
cout << " if You want to create an account press C" <<endl;
cin >> ch;
if ( ch == 'C')
{
u.getamount();
for (int i=0; i<4; i++)
{
cout << "**********************************" << endl;
cout << " If you want to view the detail press V" << endl;
cout << " To view serials enter S" << endl;
cout << " If you want to deactivate your account press D " <<endl;
cout << " If you want to exit press E" <<endl;
cin >> ch;
if ( ch == 'V')
{
u.getdetail();
}
else if ( ch=='S')
{
u.deac();
return 0;
}
else if ( ch == 'E')
{
cout << " exit" << endl;
return 0;
}
else
{
cout << " invalid input" <<endl;
}
}
}
else
{
cout << " you don't want to creat your account " << endl;
}
return 0;
}