-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuize.cpp
More file actions
359 lines (350 loc) · 7.22 KB
/
Quize.cpp
File metadata and controls
359 lines (350 loc) · 7.22 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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void design();
int score(int,int,int);
void simple();
int re1[]={3,1,4,3,2,1,3,3,4,2};
int gre=0;
int u=0;
main()
{
aa:
design();
int ch,scr=0;
scanf("%d",&ch);
switch(ch)
{
case 1:
{
int lol;
printf("Terms and Conditions to follow:\n\n");
printf("Each Questions Carries 1 marks.\n");
printf("0.25 is reduced for wrong answer.\n");
printf("Press 0 to skip a question.\n\n\n");
printf("Press 1 to accept Terms and Conditions else press any key to exit:\n");
scanf("%d",&lol);
if(lol==1)
simple();
else
exit(0);
}
break;
case 2:
{
printf("All Answers are given Blow:\n");
for(int kk=1;kk<=10;kk++)
{
printf(" %d.",kk);
printf("%d",re1[kk-1]);
}
printf("\n\n");
}
break;
case 3:
{
printf("Gold Medal for 10 marks.\n");
printf("Silver Medal for 9-10 marks.\n");
printf("Bronze Medal for 8-9 marks.\n");
}
case 4:
{
exit(0);
}
default:
{
int zz;
printf("Wrong Choice!Press 1 to try Again else press any key to Exit.");
scanf("%d",&zz);
if(zz==1)
goto aa;
else
exit(0);
}
}
}
void design()
{
system(" COLOR 5F");
printf(" * * * * * * * * * * * * * * * * * * * * *");
printf("\n\n\t\t\t* Press 1 to start Quize *");
printf("\n\n\t\t\t* Press 2 to see answers *");
printf("\n\n\t\t\t* Press 3 to see Prizes *");
printf("\n\n\t\t\t* Press 4 to Exit: *");
printf("");
printf("");
printf("\n");
printf("\n * * * * * * * * * * * * * * * * * * * * *");
}
void simple()
{
int wa=0;int skp=0; float m1=0;
int re[10];
n11:
printf("\n1.What is the Largest Animal on Earth?\n");
printf("1.Elephant 2.Shark 3.Blue Wheal 4.Anaconda\n");
scanf("%d",&re[0]);
if(re1[0]==re[0])
{
m1=m1+1;
printf("Correct Answer.\n");
}
if(re[0]==0)
{
skp++;
goto n1;
}
if(re[0]>4)
{
printf("Invalid!Try Again:\n");
goto n11;
}
if(re[0]!=re1[0] && re[0]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Blue Wheal.\n");
wa=wa+1;
}
n1:
n22:
printf("\n2.What is the Tallest Building on Earth?\n");
printf("1.Burj Khalifa 2.Taipei 101 3.Lotte World Tower 4.Abraj Al-Bait Clock Tower\n");
scanf("%d",&re[1]);
if(re[1]==re1[1])
{
m1=m1+1;
printf("Correct Answer.\n");
}
if(re[1]==0)
{
skp++;
goto n2;
}
if(re[1]!=re1[1] && re[1]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Burj Khalifa.\n");
wa++;
}
if(re[1]>4)
{
printf("Invalid!Try Again:\n");
goto n22;
}
n2:
n33:
printf("\n3.C language was developed by?\n");
printf("1.Jhon Vown Newman 2.Guido van Rossum 3.Bjarne Stroustrup 4.Dennis M. Ritchie\n");
scanf("%d",&re[2]);
if(re[2]==re1[2])
{
m1++;
printf("Correct Answer.\n");
}
if(re[2]==0)
{
skp++;
goto n3;
}
if(re[2]!=re1[2] && re[2]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Dennis M. Ritchie\n");
wa++;
}
if(re[2]>4)
{
printf("Invalid!Try Again:\n");
goto n33;
}
n3:
n44:
printf("\n4.When was the first e-mail sent ?\n");
printf("1.1963 2.1969 3.1971 4.1974\n");
scanf("%d",&re[3]);
if(re[3]==re1[3])
{
m1++;
printf("Correct Answer.\n");
}
if(re[3]==0)
{
skp++;
goto n4;
}
if(re[3]!=re1[3] && re[3]<=4)
{
printf("Wrong Answer.\nCorrect Answer is 1971.");
wa++;
}
if(re[3]>4)
{
printf("Invalid!Try Again:\n");
goto n44;
}
n4:
n55:
printf("\n5.What type of memory is volatile ?\n");
printf("1.Cache 2.RAM 3.ROM 4.Hard Drive\n");
scanf("%d",&re[4]);
if(re[4]==re1[4])
{
m1++;
printf("Correct Answer.\n");
}
if(re[4]==0)
{
skp++;
goto n5;
}
if(re[4]!=re1[4] && re[4]<=4)
{
printf("Wrong Answer.\nCorrect Answer is RAM");
wa++;
}
if(re[4]>4)
{
printf("Invalid!Try Again:\n");
goto n55;
}
n5:
n66:
printf("\n6.Which of the below is not an iPhone 4 feature ?\n");
printf("1.4G 2.Front facing camera 3.HD recording 4.Multitasking \n");
scanf("%d",&re[5]);
if(re[5]==re1[5])
{
m1++;
printf("Correct Answer.\n");
}
if(re[5]==0)
{
skp++;
goto n6;
}
if(re[5]!=re1[5] && re[5]<=4)
{
printf("Wrong Answer.\nCorrect Answer is 4G.");
wa++;
}
if(re[5]>4)
{
printf("Invalid!Try Again:\n");
goto n66;
}
n6:
n77:
printf("\n7.For reproducing sound the CD audio player uses a ?\n");
printf("1.Quartz Cristal 2.Titanium Needle 3.Laser Beam 4.Barium Titanium Ceramic\n");
scanf("%d",&re[6]);
if(re[6]==re1[6])
{
m1++;
printf("Correct Answer.\n");
}
if(re[6]==0)
{
skp++;
goto n7;
}
if(re[6]!=re1[6] && re[6]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Laser Beam.\n");
wa++;
}
if(re[6]>4)
{
printf("Invalid!Try Again:\n");
goto n77;
}
n7:
n88:
printf("\n8.What does SSL stands for ?\n");
printf("1.System socket layer 2.Secure system login 3.Secure socket layer 4.Secure system login\n");
scanf("%d",&re[7]);
if(re[7]==re1[7])
{
m1++;
printf("Correct Answer\n");
}
if(re[7]==0)
{
skp++;
goto n8;
}
if(re[7]!=re1[7] && re[7]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Secure socket layer.\n");
wa++;
}
if(re[7]>4)
{
printf("Invalid!Try Again:\n");
goto n88;
}
n8:
n99:
printf("\n9.What is MAC ?\n");
printf("1.A computer made by Apple 2.Memory address corruption 3.Mediocre Apple Computer 4.Media Access Control\n");
scanf("%d",&re[8]);
if(re[8]==re1[8])
{
m1++;
printf("Correct Answer.\n");
}
if(re[8]==0)
{
skp++;
goto n9;
}
if(re[8]!=re1[8] && re[8]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Media Access Control.");
wa++;
}
if(re[8]>4)
{
printf("Invalid!Try Again:\n");
goto n99;
}
n9:
nnn:
printf("\n10.Which person was the first to offer a definition of the term 'computer virus'?\n");
printf("1.Smith 2.Cohen 3.Norton 4.Mcafee\n");
scanf("%d",&re[9]);
if(re[9]==re1[9])
{
m1++;
printf("Correct Answer.\n");
}
if(re[9]==0)
{
skp++;
goto nn;
}
if(re[9]!=re1[9] && re[9]<=4)
{
printf("Wrong Answer.\nCorrect Answer is Cohen.\n");
wa++;
}
if(re[9]>4)
{
printf("Invalid!Try Again:\n");
goto nnn;
}
nn:
int oo=m1;
m1=m1-wa*0.25;
printf("-------------------RESULT-------------------\n");
printf("Questions Attepted:%d\n",(10-skp));
printf("Rignt Answers%d\n",oo);
printf("Wrong Answers:%d\n",wa);
printf("Score:%.3f\n",m1);
printf("----------------------------------------------\n\n");
if(m1==10)
printf("CONGRATULATIONS! YOU WON GOLD MEDEL\n");
if(m1>=9 && m1<10)
printf("CONGRATULATIONS! YOU WON SILVER MEDEL\n");
if(m1>=8 && m1<9)
printf("CONGRATULATIONS! YOU WON BRONZE MEDEL\n");
if(m1<8)
printf("SORRY!YOU DID NOT WON ANY MEDEL!TRY AGAIN\n\n");
printf("***************THANK YOU******************");
}