-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdd.cpp
More file actions
1664 lines (1624 loc) · 39.1 KB
/
Copy pathdd.cpp
File metadata and controls
1664 lines (1624 loc) · 39.1 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
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<time.h>
#include<fstream>
#include<iostream>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<windows.h>
using namespace std;
char userid[32];
void border();
int menu(string menus[],int options,char* ch);
void gotoxy(short a, short b)
{
COORD coordinates;
coordinates.X = a;
coordinates.Y = b;
SetConsoleCursorPosition(
GetStdHandle(STD_OUTPUT_HANDLE), coordinates);
}
int random(int range)
{
return (rand() % range);
}
void credits()
{system("cls");
border();
gotoxy(2,2);
cout<<"This Project Was Made In Collaboration By Pranav,Allen,Vaibhav And Gopi\n";
gotoxy(2,3);
cout<<"Special Thanks To Mr.Pius Mathew For Giving Us The Opportunity To Do This\n";
gotoxy(2,4);
cout<<"Goodbye";
getch();
system("cls");
}
class Calculator
{
public:
void Menu();
void design();
void Algebra();
void Power();
void Trig();
};
void Calculator::design()
{
gotoxy(13,6); cout<<"* *";
gotoxy(13,7); cout<<" * * ";
gotoxy(13,8); cout<<" * * ";
gotoxy(13,9); cout<<" * * ";
gotoxy(13,10);cout<<" ** ";
gotoxy(13,11);cout<<" ** ";
gotoxy(13,12);cout<<" * * ";
gotoxy(13,13);cout<<" * * ";
gotoxy(13,14);cout<<" * * ";
gotoxy(13,15);cout<<"* * ";
gotoxy(55,6);cout<<" ";
gotoxy(55,7); cout<<" /| ";
gotoxy(55,8); cout<<" / | ";
gotoxy(55,9); cout<<" / | ";
gotoxy(55,10);cout<<" / | ";
gotoxy(55,11);cout<<" / | ";
gotoxy(55,12);cout<<" / | ";
gotoxy(55,13);cout<<" / | ";
gotoxy(55,14);cout<<" / __| " ;
gotoxy(55,15);cout<<"/_ _ _|_ | ";
gotoxy(45,16);cout<<" ___ ";
gotoxy(45,17);cout<<" | |";
gotoxy(45,18);cout<<" _________________ ";
gotoxy(45,19);cout<<"[_________________]";
gotoxy(45,20);cout<<" ";
gotoxy(45,21);cout<<" |___|";
gotoxy(45,22);cout<<" ";
}
void Calculator::Algebra()
{
double val1,val2;
char ch;
NEW:
gotoxy(24,8);cout<<"Value 1";gotoxy(37,8);cout<<"Operator";gotoxy(49,8);cout<<"Value 2";gotoxy(30,20);cout<<" Press 'C' to Clear";
gotoxy(30,22);cout<<" Press 'M' to MENU";
gotoxy(22,9);cout<<"|-----------|";
gotoxy(22,10);cout<<"|"; gotoxy(34,10);cout<<"|";
gotoxy(22,11);cout<<"|-----------|";
gotoxy(38,9);cout<<"|-----|";
gotoxy(38,10);cout<<"|"; gotoxy(44,10);cout<<"|";
gotoxy(38,11);cout<<"|-----|";
gotoxy(48,9);cout<<"|-----------|";
gotoxy(48,10);cout<<"|"; gotoxy(60,10);cout<<"|";
gotoxy(48,11);cout<<"|-----------|";
gotoxy(22,13);cout<<"|----------------------|";
gotoxy(22,14);cout<<"|";gotoxy(45,14);cout<<"|";
gotoxy(22,15);cout<<"|----------------------|";
gotoxy(24,10);cin>>val1;
OP:
gotoxy(48,9);cout<<"|-----------|";
gotoxy(48,10);cout<<"|"; gotoxy(60,10);cout<<"|";
gotoxy(48,11);cout<<"|-----------|";
gotoxy(38,9);cout<<"|-----|";
gotoxy(38,10);cout<<"|"; gotoxy(44,10);cout<<"|";
gotoxy(38,11);cout<<"|-----|";
gotoxy(41,10);ch=getch();
if(ch!='+'&&ch!='-'&&ch!='*'&&ch!='/'&&ch!='c'&&ch!='m')
{gotoxy(37,10);cout<<"INVALID";gotoxy(37,11);cout<<"Please retry";
getch();
gotoxy(37,10);cout<<" ";gotoxy(37,11);cout<<" ";
goto OP;
}
if(ch=='M')
return;
if(ch=='C')
{gotoxy(24,10);cout<<" ";gotoxy(37,10);cout<<" ";
gotoxy (24,14);cout<<" ";goto NEW;
}
else
gotoxy(41,10);cout<<ch ;
gotoxy(49,10);cin>>val2;
if(ch=='+')
{
gotoxy (24,14);cout<<val1<<' '<<ch<<' '<<val2<<' '<<"= "<<val1+val2;
val1=val1+val2;
gotoxy(24,10);cout<<val1<<" ";
gotoxy(39,10);cout<<" ";
gotoxy(49,10);cout<<" ";
goto OP;
}
if(ch=='-')
{
gotoxy (24,14);cout<<val1<<' '<<ch<<' '<<val2<<' '<<"= "<<val1-val2;
val1=val1-val2;
gotoxy(24,10);cout<<val1<<" ";
gotoxy(39,10);cout<<" ";
gotoxy(48,10);cout<<" ";
goto OP;
}
if(ch=='*')
{
gotoxy (24,14);cout<<val1<<' '<<ch<<' '<<val2<<' '<<"= "<<val1*val2;
val1=val1*val2;
gotoxy(24,10);cout<<val1<<" ";
gotoxy(39,10);cout<<" ";
gotoxy(48,10);cout<<" ";
goto OP;
}
if(ch=='/')
{
gotoxy (24,14);cout<<val1<<' '<<ch<<' '<<val2<<' '<<"= "<<val1/val2;
val1=val1/val2;
gotoxy(24,10);cout<<val1<<" ";
gotoxy(39,10);cout<<" ";
gotoxy(48,10);cout<<" ";
goto OP;
}
}
void Calculator::Power()
{
double val1,val2;
char ch;
NEW:
gotoxy(24,8);cout<<"Value 1";gotoxy(41,10);cout<<"^";gotoxy(49,8);cout<<" Power";gotoxy(30,20);
gotoxy(22,9);cout<<"|-----------|";
gotoxy(22,10);cout<<"|"; gotoxy(34,10);cout<<"|";
gotoxy(22,11);cout<<"|-----------|";
gotoxy(38,9);cout<<"|-----|";
gotoxy(38,10);cout<<"|"; gotoxy(44,10);cout<<"|";
gotoxy(38,11);cout<<"|-----|";
gotoxy(48,9);cout<<"|-----------|";
gotoxy(48,10);cout<<"|"; gotoxy(60,10);cout<<"|";
gotoxy(48,11);cout<<"|-----------|";
gotoxy(22,13);cout<<"|----------------------|";
gotoxy(22,14);cout<<"|";gotoxy(45,14);cout<<"|";
gotoxy(22,15);cout<<"|----------------------|";
gotoxy(24,10);cin>>val1;
LO:
gotoxy(48,9);cout<<"|-----------|";
gotoxy(48,10);cout<<"|"; gotoxy(60,10);cout<<"|";
gotoxy(48,11);cout<<"|-----------|";
gotoxy(38,9);cout<<"|-----|";
gotoxy(38,10);cout<<"|"; gotoxy(44,10);cout<<"|";
gotoxy(38,11);cout<<"|-----|";
gotoxy(50,10);cin>>val2;
gotoxy (24,14);cout<<val1<<' '<<"^"<<val2<<' '<<"= "<<pow(val1,val2);
val1=pow(val1,val2);
gotoxy(24,10);cout<<val1<<" ";
gotoxy(49,10);cout<<" ";
gotoxy(30,17);cout<<"Press any ch to continue";
gotoxy(30,18);cout<<"Press'C' to clear";
gotoxy(30,19);cout<<"Press 'M' for menu";
ch=getch();
if(ch=='m')
return;
if(ch=='c')
{gotoxy(24,10);cout<<" ";gotoxy(37,10);cout<<" ";
gotoxy (24,14);cout<<" ";goto NEW;
}
goto LO;
}
void Calculator::Trig()
{ gotoxy(15,7);cout<<"1.'S'in\n";
gotoxy(15,9);cout<<"2.'C'os"<<endl;
gotoxy(15,11);cout<<"3.'T'an\n";
char ch;
float val;
gotoxy(35,14);ch=getch();
ME:
gotoxy(35,16);cout<<" ";
gotoxy(34,18);cout<<" ";
if(ch=='s')
{
gotoxy(35,14);cout<<"sin( )";
gotoxy(39,14);cin>>val;
gotoxy(35,16);cout<<"= "<<sin(val*(3.1415/180));
gotoxy(34,18);cout<<"Choose option or Press 'M' for Menu";
ch=getch();
if(ch=='m')
return;
else
goto ME;
}
if(ch=='c')
{
gotoxy(35,14);cout<<"cos( )";
gotoxy(39,14);cin>>val;
gotoxy(35,16);cout<<"= "<<cos(val*(3.1415/180));
gotoxy(34,18);cout<<"Choose option or Press 'M' for Menu";
ch= getch();
if(ch=='m')
return;
else
goto ME;
}
if(ch=='t')
{
gotoxy(35,14);cout<<"tan( )";
gotoxy(39,14);cin>>val;
gotoxy(35,16);cout<<"= "<<tan(val*(3.1415/180));
gotoxy(34,18);cout<<"Choose option or Press 'M' for Menu";
ch=getch();
if(ch=='m')
return;
else
goto ME;
}
}
void Calculator::Menu()
{
RE:
system("cls");border();
string calc[]={"Basic Math","Trigonometry","Exponential","Back"};
switch(menu(calc,4,"Calculator"))
{
case 1: system("cls");
border();
gotoxy(15,6);cout<<"Operators: +, -, * , /";
Algebra();
goto RE;
case 2:system("cls");
border();
gotoxy(15,6);cout<<"TRIGNOMETRY";
Trig();
goto RE;
case 3:system("cls");border();
gotoxy(12,7) ;cout<<"POWERS";
Power();
goto RE;
case 4:return;
}
}
//CALC END
void heading(char ch[]);
//CONTACTS START
class Contacts
{ public:
char name[30];
char number[30];
char email[40];
int state;
void Menu();
void Addcontact();
void Delete();
void Display();
};
void Contacts::Menu()
{int option;
char ch;
RE:
system("cls");
border();
string CONTACTS[]={"Add Contacts","Delete Contacts","Display Contacts","Exit"};
switch(menu(CONTACTS,4,"CONTACTS"))
{
case 1: system("cls");
border();
Addcontact();
break;
case 2: system("cls");
border();
Delete();
break;
case 3: system("cls");
border();
Display();
break;
case 4: return;
};
goto RE;
}
void Contacts::Addcontact()
{Contacts c;BE:
gotoxy(20,18);cout<<"Press 'A' to Add another contact";
gotoxy(20,20);cout<<"Press 'M' to Return to Menu";
ofstream fout("ontactsss.dat",ios::app|ios::binary);
gotoxy(20,9); cout<<"Enter Details of contact to be added";
gotoxy(20,12);cout<<"Name:-";
gotoxy(20,14);cout<<"Number:-";
gotoxy(20,16);cout<<"Email ID:-";
gotoxy(27,12);gets(c.name);
gotoxy(29,14);gets(c.number);
gotoxy(31,16);gets(c.email);
c.state=1;
fout.write((char*)&c,sizeof(c));
fout.close();
RE:
char ch=getch();
if(ch=='A'||ch=='a')
goto BE;
else
if(ch=='M'||ch=='m')
return;
else
{gotoxy(20,21);cout<<"Retry";
getch();gotoxy(20,21);cout<<" ";
goto RE;
}
}
void Contacts::Delete()
{ int choice;
string DEL[]={"Name","Number","Email ID","Exit"};
choice=menu(DEL,4,"Delete According To");
system("cls");border();
fstream fin("ontactsss.dat",ios::in|ios::out|ios::binary);
Contacts c;
char s[40];
int x=0;
if(choice==1)
{
gotoxy(20,12);cout<<"Name:-";gotoxy(27,12);gets(s);
}
if(choice==2)
{
gotoxy(20,12);cout<<"Number:-";gotoxy(28,12);gets(s);
}
if(choice==3)
{
gotoxy(20,12);cout<<"Email ID:-";gotoxy(31,12);gets(s);
}
if(choice==4)
{system("cls");return;}
while(fin.read((char*)&c,sizeof(c)))
{
if(choice==1)
{
if (strcmp(s,c.name)==0)
{c.state=0;
fin.seekp(fin.tellg()-sizeof(c),ios::beg);
fin.write((char*)&c,sizeof(c));
x=1;
}
}
else
if(choice==2)
{
if (strcmp(s,c.number)==0)
{c.state=0;
fin.seekp(fin.tellg()-sizeof(c),ios::beg);
fin.write((char*)&c,sizeof(c)); x=1;
}
}
else
if(choice==3)
{
if (strcmp(s,c.email)==0)
{c.state=0;
fin.seekp(fin.tellg()-sizeof(c),ios::beg);
fin.write((char*)&c,sizeof(c)); x=1;
}
}
}
system("cls");
border();
if(x==1)
{gotoxy(18,15);cout<<"CONTACT DELETED";return;
}
else
{gotoxy(18,15);cout<<"CONTACT NOT FOUND"; return;
}
fin.close();
}
void Contacts::Display()
{ int i=10;
Contacts c;
ifstream fin("ontactsss.dat",ios::in|ios::binary);
for(int k=14;k<70;k++)
{gotoxy(k,7);cout<<'-';gotoxy(k,21);cout<<'-';gotoxy(k,9);cout<<'-';
}
for(int j=8;j<21;j++)
{gotoxy(14,j);cout<<'|';gotoxy(34,j);cout<<'|';gotoxy(49,j);cout<<'|';gotoxy(70,j);cout<<'|';
}
gotoxy(15,8);cout<<" NAME";gotoxy(35,8);cout<<" NUMBER";gotoxy(50,8);cout<<" EMAIL"<<endl;
while(fin.read((char*)&c,sizeof(c)))
{
if(c.state==1)
{
gotoxy(15,i);cout<<c.name;gotoxy(35,i);cout<<c.number;gotoxy(50,i);cout<<c.email<<endl; i++;
}
}
fin.close();
}
//CONTACTS END
//LOGIN START
int login()
{border();
char password[32],ch,user[][10]={"Admin","PASSWORD"};
int i=0,n=0;
long j;
system("cls");
border();
gotoxy(25,12);
cout<<"PRESS ANY KEY TO CONTINUE";
getch();
START:
system("cls");
border();
gotoxy(25,10);
cout<<"LOGIN:"<<" ";
gets(userid);
gotoxy(25,12);
cout<<"PASSWORD:"<<" ";
while(TRUE)
{
ch=getch();
if(ch==8 && i!=0)
{i--;
password[i]=' ';
cout<<'\b';
cout<<' ';
cout<<'\b';
}
else if(ch==13)
{
password[i]='\0';
gotoxy(27,15);
cout<<"SIGNING IN..."<<endl;
for(long k;k<5000000;k++);
break;
}
else
{
password[i]=ch;
cout<<password[i];
++i;
// cout<<"*";
}
}
if(strcmp(userid,user[0])&&strcmp(password,user[1]))
{
system("cls");
border();gotoxy(25,2);
cout<<"WELCOME TO DIGITAL DIARY,"<<" "<<userid<<endl;
getch();
return 1;
}
else if(i<6)
{gotoxy(27,15);
cout<<"MINIMUM PASSWORD CHARACTERS REQUIRED = 6"<<endl<<"CLICK TO CONTINUE";
getch();
system("cls");
goto START;
}
else if(n<=2)
{gotoxy(27,15);
cout<<"SORRY, TRY AGAIN"<<endl;
++n;
getch();
system("cls");
goto START;
}
else
{ gotoxy(27,15);
cout<<"THANK YOU";
}
return 0;
}//LOGIN END
//AESTHETIC START
void heading(char ch[])
{ long k;
int i,j;
gotoxy(35,4);cout<<ch;
for(i=42,j=41;i<77;i++,j--)
{ for(k=0;k<6500000;k++);
gotoxy(i,5);cout<<"=";
gotoxy(j,5);cout<<"=";
gotoxy(i,3);cout<<"=";
gotoxy(j,3);cout<<"=";
gotoxy(7,4);cout<<"|";
gotoxy(76,4);cout<<"|";
}
}
struct POS
{int X;
int Y;
};
void border()
{int i;
gotoxy(0,0);
cout<<"+";
for(i=1;i<79;i++)
cout<<"-";
gotoxy(80,0);
cout<<"+";
for(i=1;i<24;i++)
{ gotoxy(0,i);
cout<<"|";
gotoxy(80,i);
cout<<"|";
}
gotoxy(0,24);
cout<<"+";
for(i=2;i<80;i++)
{ gotoxy(i,24);
cout<<"-";
}
gotoxy(80,24);
cout<<"+";
}//AESTHETIC END
//TIME START
struct TimeZone
{int hr;
int m;
};
char Zone();
TimeZone C, GMT;
void time()
{char ch;
TimeZone temp;
border();
gotoxy(30,2);
cout<<"Enter Current TimeZone";
cin>>C.hr>>C.m;
system("cls");
border();
GMT.hr=-C.hr;
GMT.m=-C.m;
TimeZone IST={GMT.hr+5,GMT.m+30},BST={GMT.hr+3,GMT.m},NYT={GMT.hr-4,GMT.m},SYD={GMT.hr+10,GMT.m},TYO={GMT.hr+9,GMT.m};
temp.hr=0;
temp.m=0;
UP:
system("cls");
border();
gotoxy(28,22);
cout<<"Press O for options";
int x=1,y=0,z=0;
while(x)
{time_t Cur;
time(&Cur);
struct tm *Time=localtime(&Cur);
gotoxy(35,10);
if((Time->tm_min+temp.m)>=60)
{Time->tm_hour++;
Time->tm_min=Time->tm_min-60+temp.m;
y=1;
}
else if((Time->tm_min+temp.m)<0)
{Time->tm_hour--;
Time->tm_min=Time->tm_min-temp.m+60;
y=1;}
if((Time->tm_hour+temp.hr)>=24)
{Time->tm_hour=Time->tm_hour+(temp.hr-24);
z=1;
}
else if((Time->tm_min+temp.m)<0)
{Time->tm_hour=Time->tm_hour+(24+temp.hr);
z=1;
}
if(z==0)
if((Time->tm_hour+temp.hr)<10)
cout<<0<<(Time->tm_hour+temp.hr)<<":";
else cout<<(Time->tm_hour+temp.hr)<<":";
else
if((Time->tm_hour)<10)
cout<<0<<(Time->tm_hour)<<":";
else cout<<(Time->tm_hour)<<":";
if(y==0)
if((Time->tm_min+temp.m)<10)
cout<<0<<(Time->tm_min+temp.m)<<":";
else cout<<(Time->tm_min+temp.m)<<":";
else
if((Time->tm_min)<10)
cout<<0<<(Time->tm_min)<<":";
else cout<<(Time->tm_min)<<":";
if(Time->tm_sec<10)
cout<<0<<Time->tm_sec;
else cout<<Time->tm_sec;
if(kbhit())
{ch=getch();
if(ch=='O')
{string TIME[]={"London","India","New York","Tokyo ","Sydney","Bahrain","Current","Exit"};
int opt=menu(TIME,8,"TIME");
switch(opt)
{case 1:temp.hr=GMT.hr;
temp.m=GMT.m;
break;
case 2:temp.hr=IST.hr;
temp.m=IST.m;
break;
case 7:temp.hr=C.hr;
temp.m=C.m;break;
case 3:temp.hr=NYT.hr;
temp.m=NYT.m;break;
case 4:temp.hr=TYO.hr;
temp.m=TYO.m;break;
case 5:temp.hr=SYD.hr;
temp.m=SYD.m;break;
case 6:temp.hr=BST.hr;
temp.m=BST.hr;break;
case 8:return;
};
goto UP;
}
}}
}
//TIME END
//CONV START
void con()
{system("cls");
int x,l,a,s,w;
double L,A,S,W;
char confirm;
string CONV[]={"LENGTH","AREA","SPEED","WEIGHT","EXIT"};
string LENGTH[]={"KM TO M","M TO CM","INCH TO CM","FOOT TO INCH","YARD TO FOOT","MILE TO KM","EXIT"};
string AREA[]={"SQ FOOT TO SQ INCH","SQ FOOT TO SQ CM","SQ YARD TO SQ FOOT","ACRE TO SQ FOOT","HECTARE TO SQ M","SQ KM TO HECTARE","SQ MILE TO SQ KM","SQ MILE TO ACRE","EXIT"};
string SPEED[]={"MPS TO KMPH","MPH TO KMPH","KNOT TO MPH","MPH TO FOOT PER SECOND","EXIT"};
string WEIGHT[]={"KG TO G","OUNCE TO G","POUND TO OUNCE","KG TO POUNDS","STONE TO POUNDS","TON TO KG","EXIT"};
CONFIRM:
switch(menu(CONV,5,"CONVERTOR"))
{case 1:
system("cls");
LENGTH:
switch(menu(LENGTH,7,"LENGTH"))
{case 1:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN KILOMETER TO METER CONVERSION"<<endl;
LENGTH1:gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"KILOMETERS="<<1000*l<<" "<<"METERS"<<endl;
CONFIRML1:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm='Y')
{
system("cls");border();gotoxy(2,2);
goto LENGTH1;
}
else if(confirm=='N')
{getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;}
else
goto CONFIRML1;
case 2:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN METER TO CENTIMETER CONVERSION"<<endl;
LENGTH2:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"METERS="<<100*l<<" "<<"CENTIMETERS"<<endl;
CONFIRML2:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{system("cls");border();gotoxy(2,2);
goto LENGTH2;
}
else if(confirm=='N')
{getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRML2;
}
case 3:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN INCH TO CENTIMETER CONVERSION"<<endl;
LENGTH3:
gotoxy(2,3);gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"INCHES="<<l*2.54<<" "<<"CENTIMETERS"<<endl;
CONFIRML3:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto LENGTH3;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRML3;
}
case 4:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN FOOT TO INCH CONVERSION"<<endl;
LENGTH4:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"FEET="<<l*12<<" "<<"INCHES"<<endl;
CONFIRML4:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto LENGTH4;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRML4;
}
case 5:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN YARD TO FOOT CONVERSION"<<endl;
LENGTH5:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"YARD="<<l*3<<" "<<"FEET"<<endl;
CONFIRML5:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto LENGTH5;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRML5;
}
case 6:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN MILE TO KILOMETER CONVERSION"<<endl;
LENGTH6:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>l;
gotoxy(2,4);cout<<l<<" "<<"MILE="<<l*1.6093<<" "<<"KILOMETERS"<<endl;
CONFIRML6:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto LENGTH6;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto LENGTH;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRML6;
}
case 7:
system("cls");border();gotoxy(2,2);
goto CONFIRM;
};
case 2:
system("cls");border();gotoxy(2,2);
AREA:
switch(menu(AREA,9,"AREA"))
{case 1:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN SQUARE FOOT TO SQUARE INCH CONVERSION"<<endl;
AREA1:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"SQUARE FOOT="<<a*144<<" "<<"SQUARE INCHES"<<endl;
CONFIRMA1:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA1;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto AREA;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRMA1;
}
case 2:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN SQUARE FOOT TO SQUARE CENTIMETER CONVERSION"<<endl;
AREA2:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"SQUARE FOOT="<<a*929.0304<<" "<<"SQUARE CENTIMETERS"<<endl;
CONFIRMA2:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA2;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto AREA;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRMA2;
}
case 3:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN SQUARE YARD TO SQUARE FOOT CONVERSION"<<endl;
AREA3:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"SQUARE YARD="<<a*9<<" "<<"SQUARE FOOT"<<endl;
CONFIRMA3:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA3;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto AREA;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRMA3;
}
case 4:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN ACRE TO SQUARE FOOT CONVERSION"<<endl;
AREA4:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"ACRE="<<a*43560<<" "<<"SQUARE FOOT"<<endl;
CONFIRMA4:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA4;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto AREA;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRMA4;
}
case 5:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN HECTARE TO SQUARE METER CONVERSION"<<endl;
AREA5:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"HECTARE="<<a*10000<<" "<<"SQUARE METER"<<endl;
CONFIRMA5:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA5;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();
system("cls");border();gotoxy(2,2);
goto AREA;
}
else
{
cout<<"SORRY"<<endl;
goto CONFIRMA5;
}
case 6:
system("cls");border();gotoxy(2,2);
cout<<"YOU HAVE CHOSEN SQUARE KILOMETER TO HECTARE CONVERSION"<<endl;
AREA6:
gotoxy(2,3);cout<<"ENTER VALUE:";
cin>>a;
gotoxy(2,4);cout<<a<<" "<<"SQUARE KILOMETER="<<a*100<<" "<<"HECTARE"<<endl;
CONFIRMA6:
gotoxy(2,5);cout<<"DO YOU WANT TO CONTINUE?"<<endl;
confirm=getch();
if(confirm=='Y')
{
system("cls");border();gotoxy(2,2);
goto AREA6;
}
else if(confirm=='N')
{
cout<<"THANK YOU";
getch();