Help mE Their is Some MisTake.....

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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#include <iostream.h>
#include <conio.h>
#include <string.h>
using namespace std;
class move_que;
class Viewer{
public:
Viewer * Get_Next(){
        return Next_Node;
        }
void Set_Next(Viewer * next_node){
     Next_Node = next_node;
}
char Get_Group(){
     return Group;
     }
void Set_Group(char group){Group = group;}
private:
Viewer * Next_Node;
char Group;

};
class move_que{

public:
move_que();
void add_ticket();
void total_vistors(char*);
int total_revenu(char*);
void papularity(char*);
private:
Viewer * front;
Viewer * rear;
int counter;

};
move_que::move_que()
{
counter = 0;
front = NULL;
rear = NULL;
}
int move_que::total_revenu(char* movi_name)
{
int temp = 0;
for(int i=0;i<counter;i++)
{
temp += 650;
}
if(strcmp(movi_name,"English Vinglish") == 0)
{
cout<<movi_name<<'\t'<<temp<<endl;
}
else if(strcmp(movi_name,"Tekken") == 0)
{
cout<<movi_name<<'\t'<<'\t'<<'\t'<<temp<<endl;
}
else if(strcmp(movi_name,"Harry Potter") == 0)
{
cout<<movi_name<<'\t'<<'\t'<<temp<<endl;
}
return temp;

}

void move_que::total_vistors(char* movi_name)
{
cout<<"Total Vistors For "<<movi_name<<" are "<<counter<<endl;
}
void move_que::papularity(char* movi)
{
Viewer * temp_front = front;

int female = 0;
int male = 0;
int kids = 0;
for(int i=0;i<counter;i++)
{
if(front->Get_Group() == 'f' || front->Get_Group() == 'F')
{
female++;
}
else if(front->Get_Group() == 'm' || front->Get_Group() == 'M')
{
male++;
}
else if(front->Get_Group() == 'k' || front->Get_Group() == 'K')
{
kids++;
}
front = front->Get_Next();

}
if(female > male && female > kids)
{
cout<<movi<<" is papuler Amoung Female's"<<endl;
}
else if(male > female && male > kids)
{
cout<<movi<<" Is papuler amoung Male's"<<endl;
}
else if(kids > female && kids > male)
{
cout<<movi<<" is Papule amoung Kids"<<endl;
}
}

void move_que::add_ticket()
{
char temp_group;
Viewer * New_Node = new Viewer();
for(int i=0;;i++)
{
cout<<"Enter Your Social Group M/F/K(M for Male, F for Female, K for Kids: ";
cin>>temp_group;
if(temp_group == 'm' || temp_group == 'M'){break;}
else if(temp_group == 'f' || temp_group == 'F'){break;}
else if(temp_group == 'k' || temp_group == 'K'){break;}
else{
cout<<"Please select a right social group"<<endl;
system("pause");
continue;
}
}
New_Node->Set_Group(temp_group);
if(rear == NULL)
{
New_Node->Set_Next(NULL);
rear = New_Node;
front = New_Node;
}
else
{
New_Node->Set_Next(NULL);
rear->Set_Next(New_Node);
rear = New_Node;
}
counter++;
}

int main()
{
int mov_choice = 0;
char choice;
bool quit = false;
move_que Harry;
move_que english;
move_que Tekken;
do
{
while(quit == false)
{
cout<<"For Harry Potter Press ......1"<<endl;
cout<<"For English Vinglish Press ..2"<<endl;
cout<<"For Tekken Press ............3"<<endl;
cout<<"Please Enter Valid Choice (1-3) : ";
cin>>mov_choice;
switch(mov_choice)
{
case 1:
Harry.add_ticket();
quit = true;
break;
case 2:
english.add_ticket();
quit = true;
break;
case 3:
Tekken.add_ticket();
quit = true;
break;
default:
cout<<"Please Select Right Choice"<<endl;
system("pause");
system("cls");
quit = false;
}

}

cout<<"Would You Like to Buy another ticket y/Y(yes): ";
cin>>choice;
if(choice == 'y' || choice == 'Y')
{
quit = false;
}
system("cls");
}while(choice == 'y' || choice == 'Y');
int TOTAL_REVENU_1 = 0;
int TOTAL_REVENU_2 = 0;
int TOTAL_REVENU_3 = 0;
cout<<"******Response For Each Movi******"<<'\n'<<endl;
Harry.total_vistors("Harry Potter");
english.total_vistors("English Vinglish");
Tekken.total_vistors("Tekken");
cout<<'\n'<<endl<<endl;
cout<<"******Revenu Genrated By Each Movi******"<<'\n'<<endl;
cout<<"Movi"<<'\t'<<'\t'<<'\t'<<"Revenu"<<'\n'<<endl;
TOTAL_REVENU_1 += Harry.total_revenu("Harry Potter");
TOTAL_REVENU_2 += english.total_revenu("English Vinglish");
TOTAL_REVENU_3 += Tekken.total_revenu("Tekken");
cout<<'\n'<<"Total Revenu For The Cinema Is "<<TOTAL_REVENU_1+TOTAL_REVENU_2+TOTAL_REVENU_3<<endl;
if(TOTAL_REVENU_1 > TOTAL_REVENU_2 && TOTAL_REVENU_1 > TOTAL_REVENU_3)
{
cout<<"Harry Potter Is Best Seller Movi Of The Cinema"<<endl;
}
else if(TOTAL_REVENU_2 > TOTAL_REVENU_1 && TOTAL_REVENU_2 > TOTAL_REVENU_3)
{
cout<<"English Vinglish Is Best Seller Movi Of The Cinema"<<endl;

}
else if(TOTAL_REVENU_3 > TOTAL_REVENU_2 && TOTAL_REVENU_3 > TOTAL_REVENU_1)
{
cout<<"Tekken Is Best Seller Movi Of The Cinema"<<endl;
}
cout<<"******Popularity Of Each Movi amoung Social Group******"<<'\n'<<endl<<endl;
Harry.papularity("Harry Potter");
english.papularity("English Vinglish");
Tekken.papularity("Tekken");
_getch();
}



some error found in this program please help me...
Be more specific. Are you talking about compilation error's or logical error's ?

If logical, what exactly are you expecting and what the program is doing actually ?
@writeonsharma
Suppose three movies (Harry Potter, English Vinglish and Tekken) are on display in a cinema. Three different counters are distributing tickets for each movie. To purchase a particular movie ticket, you are required to stand in the respective movie counter queue.

Make you familiar with queue and linked list data structure and programming techniques to implement queue as linked list.

1
2
3
4
5
6
7
8
9
10
11
12
Considering the above scenario, write a C++ program which asks a user to choose the movie for which he/she would like to purchase a Ticket. While choosing the movie ticket, user should be asked to enter his/her social group [F for female, M for male and K for kids].
The required program functionalities should be:

Take input for all the three movies.

Display the total number of visitors for each movie.

Display total revenue of cinema and total revenue of each movie (Suppose price of one ticket is 650/-).

Display the best business earning movie of the cinema.

Check the popularity of each movie amongst social groups (females, males or kids).
And what is it doing now?

does "some error found" indicate a compilation error or something that is calculated wrong at runtime? No one is going to read 221 lines of un-indented code, then compare with your requirements.
Compile error
Change iostream.h to iostream and add #include <stdlib.h>

[Error] 'system' was not declared in this scope

[Warning] deprecated conversion from string constant to 'char*' [-Wwrite-
strings]
Actually you shouldn't be using system() at all, and don't use c-style strings but the C++ equivalent: std::string. Then all errors/warnings will disappear.
And never use conio.h, it's non-standard.
Registered users can post here. Sign in or register to post.