forked from sakshamchecker/Hacktoberfest-21
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cell Phone.cpp
1554 lines (1444 loc) · 29.6 KB
/
Cell Phone.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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include<fstream>
#include<time.h>
#include<math.h>
#include<iomanip.h>
#include<dos.h>
struct phonebook
{
char name[50];
char number[15];
void modify();
}s[500],r;
void phonebook::modify()
{
cout<<"NAME:"<<name<<endl;
cout<<"Phone Number:"<<number<<endl;
cout<<"Enter New Details"<<endl;
char nm[50]="";
char num[15]="";
cout<<"Enter New Name(Enter * To Retain Old One):"<<endl;
gets(nm);
cout<<"Enter New Number(Enter * To Retain Old One):"<<endl;
gets(num);
if(strcmp(nm,"*")!=0)
strcpy(name,nm);
if(strcmp(num,"*")!=0)
strcpy(number,num);
}
char appMen()
{ clrscr();
char n;
cout<<"********Applications*******"<<endl<<endl;
cout<<"1. Temperature Converter"<<endl;
cout<<"2. Length Converter"<<endl;
cout<<"3. Currency Exchange"<<endl;
cout<<"4. Calculator"<<endl;
cout<<"5. Exit"<<endl;
cout<<"Enter Your Choice"<<endl;
cin>>n;
return n;
}
char gamMenu()
{ clrscr();
char n;
cout<<"********Games********"<<endl<<endl;
cout<<"1. Science Quiz"<<endl;
cout<<"2. Hangman"<<endl;
cout<<"3. Exit"<<endl;
cout<<"Enter Your Choice"<<endl;
cin>>n;
return n;
}
struct callDat
{public:
char num[15];char time[26];
void putdata()
{ cout<<num<<'\t'<<time;}
}cal,retrv;
void box_fill(void)
{
textcolor(GREEN);
int xr,xc;
int la,ra;
gotoxy(10,2);
for(xr=1;xr<=51;xr++)
cprintf("±");
xc=3;
for(la=1;la<=19;la++)
{
textcolor(BLUE);
gotoxy(10,xc);
cprintf("±");
gotoxy(60,xc);
cprintf("±");
xc++;
}
textcolor(GREEN);
gotoxy(10,22);
for(xr=1;xr<=51;xr++)
cprintf("±");
}
char menu()
{ char n;
clrscr();
box_fill();
textattr(2 + ((1) << 2));
gotoxy(24,3);cprintf(" Phone Menu");
gotoxy(24,4);cprintf("___________________");
gotoxy(24,5);cprintf("\n1.Call");
gotoxy(24,7);cprintf("\n2.Phone Book ");
gotoxy(24,9);cprintf("\n3.Message ");
gotoxy(24,11);cprintf("\n4.Call Log ");
gotoxy(24,13);cprintf("\n5.Application ");
gotoxy(24,15);cprintf("\n6.Games ");
gotoxy(24,17);cprintf("\n7.Exit");
gotoxy(24,21);cprintf("Enter Your Choice");
cin>>n;
return n;
}
char pbMenu()
{
char n;
clrscr();
cout<<"********Phonebook Menu********"<<endl<<endl;
cout<<"1. Add Contact"<<endl;
cout<<"2. Search Contacts"<<endl;
cout<<"3. Edit Contacts"<<endl;
cout<<"4. Delete Contact"<<endl;
cout<<"5 View Contacts"<<endl;
cout<<"6. Delete All Contacts"<<endl;
cout<<"7. Exit"<<endl;
cout<<"Enter Your Choice"<<endl;
cin>>n;
return n;
}
char LogMen()
{ clrscr();
char n;
cout<<"********Call Log********"<<endl<<endl;
cout<<"1. View Log"<<endl;
cout<<"2. Clear Log"<<endl;
cout<<"3. Exit"<<endl;
cout<<"Enter Your Choice"<<endl;
cin>>n;
return n;
}
struct sms{
char msg[160],p_num[15];
}s1[20],s2;
void send();
void send()
{
cout<<"sending......"<<endl;
cout<<"No Connection available"<<endl;
}
char messageMenu(){
clrscr();
char n;
cout<<"******************Message Menu******************"<<endl;
cout<<"1. Outbox."<<endl;
cout<<"2. Clear Outbox"<<endl;
cout<<"3. Type SMS"<<endl;
cout<<"4. Exit"<<endl;
cout<<"Enter Your Choice:";
cin>>n;
return n;
}
void show_sms()
{
char hold[50],found='n',a='y';
int i=0;
while(a=='Y'||a=='y')
{
ifstream fi;
fi.open("C:\sms.dat",ios::in|ios::binary);
cout<<"Enter Phone Number to read the sms:";
gets(hold);
while(!fi.eof())
{
fi.read((char*) &s1[i], sizeof(sms));
if(strcmp(hold,s1[i].p_num)==0)
{
cout<<(i+1)<<"-::"<<s1[i].msg<<"::-"<<endl;
found='y';
}
i++;
}
if(found=='n')
cout<<"Name Not Found:"<<endl;
fi.close();
cout<<"Do You Want To search again (y/n)?";
cin>>a;
}
}
void outbox(){
char l;
ifstream fin;
fin.open("C:\sms.dat",ios::in|ios::binary|ios::beg);
fin.seekg(0,ios::end);
int n=fin.tellg();
fin.seekg(0,ios::beg);
while(fin.tellg()!=n)
{
fin.read((char*) &s2, sizeof(sms));
cout<<"Phone Number:"<<s2.p_num<<endl;
}
show_sms();
fin.close();
}
void type(){
char l='y';
int i=0;
ofstream fout;
fout.open("C:\sms.dat",ios::out|ios::binary|ios::app);
while(l=='y'||l=='Y')
{
clrscr();
cout<<"Enter The SMS(max 160 characters):"<<endl;
gets(s1[i].msg);
cout<<"Enter Number:"<<endl;
gets(s1[i].p_num);
fout.write((char*)&s1[i],sizeof(sms));
send();
cout<<"Do You Want To Type More SMS(y/n):"<<endl;
cin>>l;
i++;
}
fout.close();
}
void type(char phno[15]){
char l='y';
int i=0;
ofstream fout;
fout.open("C:\sms.dat",ios::out|ios::binary|ios::app);
while(l=='y'||l=='Y')
{
clrscr();
cout<<"Enter The SMS(max 160 characters):"<<endl;
gets(s1[i].msg);
strcpy(s1[i].p_num,phno);
fout.write((char*)&s1[i],sizeof(sms));
send();
cout<<"Do You Want To Type More SMS(y/n):"<<endl;
cin>>l;
i++;
}
fout.close();
}
void writeLog(char phno[ ])
{
int i;
time_t t;
time(&t);
ofstream fout;
strcpy(cal.num,phno);
for(i=0;i<26;i++)
cal.time[i]=*(ctime(& t)+(i*sizeof(char)));
fout.open("C:\log.dat",ios::app|ios::binary);
fout.write((char*)&cal,sizeof(cal));
fout.close();
}
void call(char phn[ ])
{
writeLog(phn);
cout<<"Dialling......"<<phn<<endl;
cout<<"No Connection available"<<endl;
cout<<"\nPress any key to continue..."<<endl;
getch();
}
void viewLog()
{
long m;
long n=sizeof(callDat);
ifstream fin;
fin.open("C:\log.dat",ios::in|ios::binary);
fin.seekg(0,ios::beg);
m=fin.tellg();
fin.seekg(-n,ios::end);
while(fin.tellg()!=m)
{
fin.read((char*)&retrv,sizeof(retrv));
retrv.putdata();
fin.seekg(-(2*n),ios::cur);
}
fin.read((char*)&retrv,sizeof(retrv));
retrv.putdata();
fin.close();
cout<<"\nPress any key to continue..."<<endl;
getch();
}
void sendMessage(){}
void add()
{
ofstream fout;
fout.open("C:\phbook.dat",ios::out|ios::binary|ios::app);
char l='y';
int i=0;
while(l=='y'||l=='Y')
{
cout<<"Enter Name:";
gets(s[i].name);
cout<<"Enter Phone Number:";
gets(s[i].number);
fout.write((char*)&s[i],sizeof(phonebook));
cout<<"Do You Want To Enter More Records(y/n)";
cin>>l;
i++;
}
fout.close();
}
void viewContacts()
{
ifstream fin("C:\phbook.dat",ios::in|ios::beg);
fin.seekg(0,ios::end);
int n=fin.tellg();
fin.seekg(0,ios::beg);
while(fin.tellg()!=n)
{
fin.read((char*) &r, sizeof(phonebook));
cout<<"NAME:"<<r.name<<endl;
cout<<"Phone Number:"<<r.number<<endl;
}
cout<<"\nPress any key to continue..."<<endl;
getch();
fin.close();
}
void search()
{
char hold[50],found='n',a='y',d='n',e='n';
int i=0;
while(a=='Y'||a=='y')
{
ifstream fi;
fi.open("C:\phbook.dat",ios::in|ios::binary);
cout<<"Enter Name:";
gets(hold);
while(!fi.eof())
{
fi.read((char*) &s[i], sizeof(phonebook));
if(strcmp(hold,s[i].name)==0)
{
cout<<s[i].name<<":"<<s[i].number<<endl;
cout<<"Do you want to call "<<s[i].name<<"(y/n)"<<endl;
cin>>d;
if(d=='y'||d=='Y')
call(s[i].number);
cout<<"Send Message to "<<s[i].name<<"\?(y/n)"<<endl;
cin>>e;
if(e=='y'||e=='Y')
type(s[i].number);
found='y';
break;
}
i++;
}
if(found=='n')
cout<<"Name Not Found:"<<endl;
fi.close();
cout<<"Do You Want To search again (y/n)?";
cin>>a;
}
}
void del_cont()
{
ifstream fio("C:\phbook.dat",ios::in|ios::binary);
ofstream file("temp.dat",ios::out);
fio.seekg(0,ios::end);
int n=fio.tellg();
fio.seekg(0,ios::beg);
char hold[50],found='f',confirm='n',l='y';
int i=0;
while(l=='y'||l=='Y')
{
cout<<"Enter The Name to me Deleted:";
gets(hold);
while(fio.tellg()!=n)
{ fio.read((char*) &s[i],sizeof(phonebook));
if(strcmp(hold,s[i].name)==0)
{ cout<<s[i].name<<":"<<s[i].number<<endl;
found='t';
cout<<"Are You Sure You Want To Delete This Record(y/n):";
cin>>confirm;
if(confirm=='n')
file.write((char*)&s[i],sizeof(phonebook));
}
else
file.write((char*)&s[i],sizeof(phonebook));
}
if(found=='f')
cout<<"Record Not Found:"<<endl;
file.close();
fio.close();
remove("C:\phbook.dat");
rename("temp.dat","C:\phbook.dat");
cout<<"Contact Deleted.";
cout<<"Do You Want To Delete More Records(y/n):"<<endl;
cin>>l;
}
}
void edit()
{
ofstream fou("C:\phbook.dat",ios::in|ios::binary);
ifstream fio("C:\phbook.dat",ios::in|ios::binary);
fio.seekg(0,ios::end);
int n=fio.tellg();
int pos;
fio.seekg(0,ios::beg);
char hold[50],found='f',l='y';
int i=0;
while(l=='y'||l=='Y')
{
cout<<"Enter The name of contact To Be Edited:";
gets(hold);
while(fio.tellg()!=n)
{ pos=fio.tellg();
fio.read((char*) &s[i],sizeof(phonebook));
fou.seekp(pos);
if(strcmp(hold,s[i].name)==0)
{
found='t';
s[i].modify();
fou.write((char*)&s[i],sizeof(phonebook));
}
i++;
}
if(found=='f')
cout<<"Contact not available"<<endl;
cout<<"Do you want to modify more contacts(y/n)"<<endl;
cin>>l;
}
fou.close();fio.close();
}
void cel2far()
{ char a='y';
do{ clrscr();
float c_temp;
float f_temp;
cout << "What is the Celsius temperature to convert ? ";
cin >> c_temp;
f_temp = c_temp * (9.0 / 5.0) + 32.0;
cout << "The Fahrenheit equivalent is:"<<setprecision(2)<<f_temp <<"\n";
cout<<"Do You Want To Continue(y/n)?";
cin>>a;
}while(a=='y'||a=='Y');
}
void inch2feet()
{ char a;
do{ float feet,inc;
cout << "Enter length in inch : "<<endl;
cin >> inc;
feet=inc/12;
cout << "The length in feet is-: " <<feet<<endl;
cout<<"Do You Want To Continue(y/n)?"<<endl;
cin>>a;
}while(a=='y'||a=='Y') ;
}
void currency()
{
clrscr();
int i;
char a='y';
double rate,amount;
cout<<"Enter conversion rate from Other to Re:";
cin>>rate;
do{
cout<<"Do You Want To convert-"<<endl;
cout<<"1.Others To Rupees."<<endl;
cout<<"2.Rupees To Other Currency."<<endl;
cout<<"Enter Your Choice:";
cin>>i;
if(i==2)
{ clrscr();
cout<<"Enter Amount in Rupees:"<<endl;
cin>>amount;
cout<<"Amount in Other Currency="<<(rate/amount);
}
else if(i==1)
{ clrscr();
cout<<"Enter Amount in Foreign Currency:"<<endl;
cin>>amount;
cout<<"Amount In Rupees is Rs."<<(amount*rate)<<endl;
}
else
cout<<"Wrong Choice Inserted!!!!"<<endl;
cout<<"Do You Want To Continue(y/n)?"<<endl;
cin>>a;
}while(a=='Y'||a=='y');
}
char a;
int b,i,sc,d,c,p;
void u(void)
{
gotoxy(6,3);
cout<<"------------------------------------------------";
gotoxy(10,8);
cout<<" WELCOME TO SCIENCE QUIZ";
gotoxy(6,20);
cout<<"------------------------------------------------";
getch();
}
void y(void)
{
clrscr();
gotoxy(15,11);
cout<<"INSTRUCTION FOR USER :- ";
gotoxy(15,14);
cout<<"YOU HAVE GIVEN FOUR OPTIONS";
gotoxy(15,16);
cout<<"OUT OF WHICH YOU HAVE ";
gotoxy(15,18);
cout<<"TO CHOSE ANY ONE AS YOUR ANSWER";
getch();
}
void q()
{
int row;
row=3;
clrscr();
for(i=5;i<=60;i++)
{
gotoxy(i,row);
cout<<"*";
}
row=23;
for(i=5;i<=60;i++)
{
gotoxy(i,row);
cout<<"*";
}
}
void question1()
{
sc=0;
gotoxy(10,5);
cout<<" Q1 : THE ELEMENT WITH LOWEST ";
gotoxy(16,6);
cout<<" MELTING AND BOILING POINT";
gotoxy(10,7);
cout<<" A : CU";
gotoxy(10,8);
cout<<" B : FE";
gotoxy(10,9);
cout<<" C : NI";
gotoxy(10,10);
cout<<" D : ZN";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='d')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question2()
{
gotoxy(10,5);
cout<<" Q2 : THE STUDY OF BIRD ";
gotoxy(10,7);
cout<<" A : ZOOLOGY ";
gotoxy(10,8);
cout<<" B : ASTROLOGY";
gotoxy(10,9);
cout<<" C : ORNTHOLOGY";
gotoxy(10,10);
cout<<" D : MICROLOGY";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='c')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question3()
{
gotoxy(10,5);
cout<<" Q3 : THE UNIT OF CAPACITANCE IS ";
gotoxy(10,7);
cout<<" A : NEWTON";
gotoxy(10,8);
cout<<" B : WATT";
gotoxy(10,9);
cout<<" C : OHM";
gotoxy(10,10);
cout<<" D : FARAD";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='d')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question4()
{
gotoxy(10,5);
cout<<" Q4 : WHO IS THE FATHER ";
gotoxy(16,6);
cout<<" OF COMPUTER";
gotoxy(10,7);
cout<<" A : CHARLES BABBAGE";
gotoxy(10,8);
cout<<" B : BLAISE PASCAL";
gotoxy(10,9);
cout<<" C : NEWTON";
gotoxy(10,10);
cout<<" D : FRENKLIN";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='a')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question5()
{
gotoxy(10,5);
cout<<" Q5 : WHICH INSTRUMENT IS USED";
gotoxy(16,6);
cout<<" TO MESURE EARTHQUAKE";
gotoxy(10,7);
cout<<" A : BAROMETER";
gotoxy(10,8);
cout<<" B : ANOMETER";
gotoxy(10,9);
cout<<" C : RICHTER SCALE";
gotoxy(10,10);
cout<<" D : GALVONOMETER";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='c')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question6()
{
gotoxy(10,5);
cout<<" Q6 : WHO INVENTED BULB ";
gotoxy(10,7);
cout<<" A : MARCONI";
gotoxy(10,8);
cout<<" B : RUTHERFORD"; gotoxy(10,9);
cout<<" C : EDISON";
gotoxy(10,10);
cout<<" D : HOKKINS";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='c')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question7()
{
gotoxy(10,5);
cout<<" Q7 : HEART IS DIVIDED INTO ";
gotoxy(10,7);
cout<<" A : ONE PART ";
gotoxy(10,8);
cout<<" B : TWO PART";
gotoxy(10,9);
cout<<" C : THREE PART";
gotoxy(10,10);
cout<<" D : FOUR PART";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='d')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question8()
{
gotoxy(10,5);
cout<<" Q8 : ATOM BOMB IS BASED ";
gotoxy(16,6);
cout<<" ON THE PRINCIPLE OF";
gotoxy(10,7);
cout<<" A : NUCLEAR FISSION";
gotoxy(10,8);
cout<<" B : NUCLEAR FUSION";
gotoxy(10,9);
cout<<" C : NEWTON THIRD LAW";
gotoxy(10,10);
cout<<" D : NONE OF THE ABOVE";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='a')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question9()
{
gotoxy(10,5);
cout<<" Q9 : DISTANCE OF OZONE LAYER ";
gotoxy(16,6);
cout<<" FROM EARTH";
gotoxy(10,7);
cout<<" A : 13 KM";
gotoxy(10,8);
cout<<" B : 14 KM";
gotoxy(10,9);
cout<<" C : 17 KM";
gotoxy(10,10);
cout<<" D : 16 KM";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='d')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question10()
{
gotoxy(10,5);
cout<<" Q10 : THE ATOMIC NUMBER ";
gotoxy(16,6);
cout<<" OF GLUCOSE IS";
gotoxy(10,7);
cout<<" A : 180";
gotoxy(10,8);
cout<<" B : 80";
gotoxy(10,9);
cout<<" C : 120";
gotoxy(10,10);
cout<<" D : 160";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='a')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question11()
{
gotoxy(10,5);
cout<<" Q11 : DIELECTRIC CONSTANT OF WATER";
gotoxy(10,7);
cout<<" A : 82";
gotoxy(10,8);
cout<<" B : 81";
gotoxy(10,9);
cout<<" C : 80";
gotoxy(10,10);
cout<<" D : 85";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='b')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question12()
{
gotoxy(10,5);
cout<<" Q12 : LACK OF VITAMIN D ";
gotoxy(10,7);
cout<<" A : ANAEMIA";
gotoxy(10,8);
cout<<" B : RICKETS";
gotoxy(10,9);
cout<<" C : SCURVEY";
gotoxy(10,10);
cout<<" D : GOITER";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='b')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}
void question13()
{
gotoxy(10,5);
cout<<" Q14 : WHICH BLOOD COMPONENT";
gotoxy(16,6);
cout<<" PREVENT DISEASE";
gotoxy(10,7);
cout<<" A : RBC";
gotoxy(10,8);
cout<<" B : WBC";
gotoxy(10,9);
cout<<" C : PLASMA";
gotoxy(10,10);
cout<<" D : PLATELETS";
gotoxy(10,12);
cout<<" ENTER CHOICE => ";
cin>>a;
if (a=='b')
{
gotoxy(10,14);
cout<<" YOU ARE CORRECT";
sc=sc+1;
}
else
{
gotoxy(10,14);
cout<<" YOU ARE WRONG ";
}
gotoxy(10,16);
cout<<"YOUR SCORE IS ";
cout<<sc;
getch();
}