Advertisement
Guest User

Untitled

a guest
Oct 9th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.61 KB | None | 0 0
  1. #include<fstream.h>
  2.  
  3. #include<stdio.h>
  4.  
  5. #include<conio.h>
  6.  
  7. #include<string.h>
  8.  
  9. #include<process.h>
  10.  
  11. #include<dos.h>
  12.  
  13.  
  14. void load();
  15. void ENTER()
  16. { gotoxy(20,10);
  17. cout<<"ENTER ANY KEY TO ENTER THE WORLD OF SCIENCE...";
  18. getch();
  19. clrscr();
  20. char str1[7][100]={"PPPPP EEEEE RRRRR IIIIII OOOO DDDDD IIIIII CCCC"
  21. ,"P P E R R II O O D D II C "
  22. ,"P P E R R II O O D D II C "
  23. ,"PPPPP EEEEE RRRRR II O O D D II C "
  24. ,"P E R R II O O D D II C "
  25. ,"P E R R II O O D D II C "
  26. ,"P EEEEE R R IIIIII OOOO DDDDD IIIIII CCCC"};
  27. char str2[7][100]={"TTTTTTT AAA BBBBB L EEEEEE"
  28. ," TT A A B B L E "
  29. ," TT A A B B L E "
  30. ," TT A A BBBBB L EEEE "
  31. ," TT AAAAAAA B B L E "
  32. ," TT A A B B L E "
  33. ," TT A A BBBBB LLLLL EEEEEE"};
  34.  
  35. int k;
  36. for(int i=0;i<7;i++)
  37. {
  38. k=strlen(str1[i]);
  39. k--;
  40. gotoxy(15,i+2);
  41. for(int l=0;l<k;l++)
  42. {
  43. cout<<str1[i][l];
  44.  
  45. delay(10);
  46. }
  47. cout<<endl;
  48. }
  49.  
  50. cout<<endl<<endl;
  51. for( i=0;i<7;i++)
  52. {
  53. k=strlen(str2[i]);
  54. k--;
  55. gotoxy(25,i+15);
  56. for(int l=0;l<k;l++)
  57. {
  58. cout<<str2[i][l];
  59.  
  60. delay(10);
  61. }
  62. cout<<endl;
  63. }
  64. getch();
  65. }
  66. void DISPLAY()
  67.  
  68. { clrscr();
  69.  
  70. gotoxy(6,4);
  71.  
  72. cout<<" \a P E R I O D I C T A B L E";
  73.  
  74.  
  75.  
  76. gotoxy(6,6);
  77.  
  78. cout<<"H He";
  79. delay(200);
  80. gotoxy(6,8);
  81. delay(200);
  82. cout<<"Li Be B C N O Fe Ne";
  83. delay(200);
  84. gotoxy(6,10);
  85. delay(200);
  86. cout<<"Na Mg Al Si P S Cl Ar";
  87. delay(200);
  88. gotoxy(6,12);
  89. delay(200);
  90. cout<<"K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr";
  91. delay(200);
  92. gotoxy(6,14);
  93. delay(200);
  94. cout<<"Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Ta I Xe";
  95. delay(200);
  96. gotoxy(6,16);
  97. delay(200);
  98. cout<<"Cs Ba * Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rd";
  99. delay(200);
  100. gotoxy(6,18);
  101. delay(200);
  102. cout<<"Fr Ra ** Rf Db Sg Bh Hs Mt Ds Rg Cn";
  103. delay(200);
  104. gotoxy(6,20);
  105. delay(200);
  106. cout<<" * La Ce Pr Nd Pm Sm En Gd Tb Dy Ho Er Tm Yb Ln";
  107. delay(200);
  108. gotoxy(6,22);
  109. delay(200);
  110. cout<<" ** Ac Th Pa U Np Pn Am Cm Bk Cf Es Fm Md No Lr";
  111. delay(200);
  112. cout<<"\n\n\t\t\t Press Any Key To Continue......";
  113.  
  114. getch();
  115.  
  116. }
  117.  
  118. void SHOWDATE();
  119.  
  120. void lock()
  121.  
  122. { char user[50];int n,k=3;
  123.  
  124. char a[10];
  125.  
  126. E:
  127.  
  128. clrscr();
  129.  
  130. SHOWDATE();
  131.  
  132. gotoxy(33,5);cout<<" USER:";gets(user);
  133.  
  134. gotoxy(33,7);cout<<"PASSWORD:";
  135.  
  136. for(int i=0;i<4;i++)
  137.  
  138. {
  139.  
  140. a[i]=getch();
  141.  
  142. cout<<"*";
  143.  
  144. }
  145.  
  146. if(((strcmp("ZED",user))==0)&&(strcmp("4022",a)==0))
  147.  
  148. {
  149.  
  150. gotoxy(30,11);
  151.  
  152. getch();
  153.  
  154. cout<<" Access Granted";getch();
  155.  
  156. return ;
  157.  
  158.  
  159.  
  160. }
  161.  
  162. else
  163.  
  164. { gotoxy(34,12);
  165.  
  166. cout<<"Access Denied";
  167.  
  168. gotoxy(18,14);
  169.  
  170. cout<<"Press 0 To Retry Or Any Other Key To Exit:";
  171.  
  172. cin>>n;
  173.  
  174. gotoxy(34,16);
  175.  
  176. if(n==0)
  177.  
  178. {cout<<""<<k-1<<" chances left";k--;getch();}
  179.  
  180.  
  181.  
  182.  
  183.  
  184. if(k==0)
  185.  
  186. exit(0);
  187.  
  188. if(n==0)
  189.  
  190. {
  191.  
  192. goto E;
  193.  
  194.  
  195.  
  196. }
  197.  
  198. else
  199.  
  200. { gotoxy(36,18);
  201.  
  202. cout<<"Thank You";getch();
  203.  
  204. exit(0);
  205.  
  206.  
  207.  
  208. }
  209.  
  210. }
  211.  
  212. }
  213.  
  214.  
  215.  
  216. class PERIODIC
  217.  
  218. { float mass,bp,r,rho;
  219.  
  220. int z,grp,prd;
  221.  
  222. char sym[3],ec[50],name[30];
  223.  
  224. public:
  225.  
  226. float BP();
  227.  
  228. char* NAME();
  229.  
  230. void SINGLEOUT();
  231.  
  232. float MASS();
  233.  
  234. float R();
  235.  
  236. void SYM(char []);
  237.  
  238. int Z();
  239.  
  240. void SETZ(int);
  241.  
  242. void SETMASS(float);
  243.  
  244. void SETGROUP(int);
  245.  
  246. void SETPERIOD(int);
  247.  
  248. void SETSYM(char[]);
  249.  
  250. void SETEC(char[]);
  251.  
  252. void SETBP(float);
  253.  
  254. void SETR(float);
  255.  
  256. void SETRHO(float);
  257.  
  258. void INITIALISE(int ,char [],char [],float ,int ,int ,float ,float ,float ,char []);
  259.  
  260. void IN();
  261.  
  262. void OUT();
  263.  
  264. };
  265.  
  266. float PERIODIC::BP()
  267.  
  268. {
  269.  
  270. return bp;
  271.  
  272. }
  273.  
  274. char* PERIODIC::NAME()
  275.  
  276. {
  277.  
  278. return(name);
  279.  
  280. }
  281.  
  282. void PERIODIC::SYM(char a[])
  283.  
  284. {
  285.  
  286. strcpy(a,sym);
  287.  
  288. }
  289.  
  290. float PERIODIC::MASS()
  291.  
  292. {
  293.  
  294. return mass;
  295.  
  296. }
  297.  
  298. float PERIODIC::R()
  299.  
  300. {
  301.  
  302. return r;
  303.  
  304. }
  305.  
  306. int PERIODIC::Z()
  307.  
  308. {
  309.  
  310. return z;
  311.  
  312. }
  313.  
  314. void PERIODIC::SETZ(int a)
  315.  
  316. {
  317.  
  318. z=a;
  319.  
  320. return;
  321.  
  322. }
  323.  
  324. void PERIODIC::SETMASS(float a)
  325.  
  326. {
  327.  
  328. mass=a;
  329.  
  330. return;
  331.  
  332. }
  333.  
  334. void PERIODIC::SETGROUP(int a)
  335.  
  336. {
  337.  
  338. grp=a;
  339.  
  340. return;
  341.  
  342. }
  343.  
  344. void PERIODIC::SETPERIOD(int a)
  345.  
  346. {
  347.  
  348. prd=a;
  349.  
  350. return;
  351.  
  352. }
  353.  
  354. void PERIODIC::SETSYM(char a[])
  355.  
  356. {
  357.  
  358. strcpy(sym,a);
  359.  
  360. return;
  361.  
  362. }
  363.  
  364. void PERIODIC::SETEC(char a[])
  365.  
  366. {
  367.  
  368. strcpy(ec,a);
  369.  
  370. return;
  371.  
  372. }
  373.  
  374. void PERIODIC::SETBP(float a)
  375.  
  376. {
  377.  
  378. bp=a;
  379.  
  380. return;
  381.  
  382. }
  383.  
  384. void PERIODIC::SETR(float a)
  385.  
  386. {
  387.  
  388. r=a;
  389.  
  390. return;
  391.  
  392. }
  393.  
  394. void PERIODIC::SETRHO(float a)
  395.  
  396. {
  397.  
  398. rho=a;
  399.  
  400. return;
  401.  
  402. }
  403.  
  404.  
  405.  
  406. long int size=sizeof(PERIODIC);
  407.  
  408. void PERIODIC::IN()
  409.  
  410. { SHOWDATE();
  411.  
  412. cout<<"\nEnter the name of the element:";gets(name);
  413.  
  414. cout<<"\nEnter the symbol of the element:";gets(sym);
  415.  
  416. cout<<"\nEnter the atomic number(Z in pm):";cin>>z;
  417.  
  418. cout<<"\nEnter the mass number (amu)(A):";cin>>mass;
  419.  
  420. cout<<"\nEnter the group number:";cin>>grp;
  421.  
  422. cout<<"\nEnter the period number:";cin>>prd;
  423.  
  424. cout<<"\nEnter the boiling point:";cin>>bp;
  425.  
  426. cout<<"\nEnter the density of the element(g/cm^3 at 293K):";cin>>rho;
  427.  
  428. cout<<"\nEnter the atomic radii:";cin>>r;
  429.  
  430. cout<<"\nEnter the Electronic Configuration:";gets(ec);
  431.  
  432. cout<<"\nElement created";
  433. }
  434.  
  435. void PERIODIC::OUT()
  436.  
  437. { static int k=0;
  438.  
  439. int i,j;
  440.  
  441. SHOWDATE();
  442.  
  443. if(k==0)
  444.  
  445. { textcolor(RED);
  446.  
  447. for(int l=0;l<24;l++)
  448.  
  449. {
  450.  
  451. gotoxy(42,l);
  452.  
  453. cout<<"===";
  454.  
  455. }
  456.  
  457.  
  458.  
  459. for(int n=0;n<79;n++)
  460.  
  461. {
  462.  
  463. gotoxy(n,12);
  464.  
  465. cout<<"||";
  466.  
  467. }
  468.  
  469. }
  470.  
  471. textcolor(YELLOW);
  472.  
  473. if(k==0)
  474.  
  475. { i=1;j=1; }
  476.  
  477. else if(k==1)
  478.  
  479. { i=45;j=1;
  480.  
  481. }
  482.  
  483. else if(k==2)
  484.  
  485. { i=1;j=13;}
  486.  
  487. else if(k==3)
  488.  
  489. { i=45;j=13;}
  490.  
  491.  
  492.  
  493. gotoxy(i,j);
  494.  
  495. cout<<"Name:"<<name;
  496.  
  497. gotoxy(i,j+1);
  498.  
  499. cout<<"Symbol:"<<sym;
  500.  
  501. gotoxy(i,j+2);
  502.  
  503. cout<<"Atomic Number:"<<z;
  504.  
  505. gotoxy(i,j+3);
  506.  
  507. cout<<"Mass Number:"<<mass<<" amu";
  508.  
  509. gotoxy(i,j+4);
  510.  
  511. cout<<"Group Number:"<<grp;
  512.  
  513. gotoxy(i,j+5);
  514.  
  515. cout<<"Period Number:"<<prd;
  516.  
  517. gotoxy(i,j+6);
  518.  
  519. cout<<"Boiling Point:"<<bp;
  520.  
  521. gotoxy(i,j+7);
  522.  
  523. cout<<"Denstiy of the element:"<<rho<<" g/cm^3";
  524.  
  525. gotoxy(i,j+8);
  526.  
  527. cout<<"Atomic Radius:"<<r<<" pm";
  528.  
  529. gotoxy(i,j+9);
  530.  
  531. cout<<"Electronic Configuration:"<<ec;
  532.  
  533.  
  534.  
  535. if(k==3)
  536.  
  537. { k=0;
  538.  
  539. return;
  540.  
  541. }
  542.  
  543. k++;
  544.  
  545.  
  546.  
  547. }
  548.  
  549. void PERIODIC::SINGLEOUT()
  550.  
  551. { clrscr();
  552. load();
  553. clrscr();
  554. SHOWDATE();
  555. int m,l=63,n=3;
  556.  
  557. for(int k=0;k<11;k++)
  558.  
  559. { m=18;
  560.  
  561. for(;m<l;m++)
  562.  
  563. { gotoxy(m,n);
  564.  
  565. cout<<"==";
  566.  
  567. }
  568.  
  569. n=n+2;
  570.  
  571. }
  572.  
  573. l=18;n=3;
  574.  
  575. for(k=0;k<3;k++)
  576.  
  577. { m=3;
  578.  
  579. for(;m<24;m++)
  580.  
  581. { gotoxy(l,m);
  582.  
  583. cout<<"||";
  584.  
  585. }
  586.  
  587. l=l+22;
  588.  
  589. }
  590.  
  591. gotoxy(25,4);
  592.  
  593. cout<<"NAME";
  594.  
  595. gotoxy(44,4);
  596.  
  597. cout<<name;
  598.  
  599. delay(500);
  600.  
  601. gotoxy(25,6);
  602.  
  603. cout<<"SYMBOL";
  604.  
  605. gotoxy(44,6);
  606.  
  607. cout<<sym;delay(500);
  608.  
  609. gotoxy(25,8);
  610.  
  611. cout<<"ATOMIC NUMBER";gotoxy(44,8);cout<<z;delay(500);
  612.  
  613. gotoxy(24,10);
  614.  
  615. cout<<"MASS NUMBER(amu)";gotoxy(44,10);cout<<mass;delay(500);
  616.  
  617. gotoxy(25,12);
  618.  
  619. cout<<"GROUP NUMBER";gotoxy(44,12);cout<<grp;delay(500);
  620.  
  621. gotoxy(25,14);
  622.  
  623. cout<<"PERIOD NUMBER";gotoxy(44,14);cout<<prd;delay(500);
  624.  
  625. gotoxy(25,16);
  626.  
  627. cout<<"BOILING POINT";gotoxy(44,16);cout<<bp;delay(500);
  628.  
  629. gotoxy(25,18);
  630.  
  631. cout<<"DENSITY(g/cm^3)";gotoxy(44,18);cout<<rho;delay(500);
  632.  
  633. gotoxy(25,20);
  634.  
  635. cout<<"ATOMIC RADIUS";gotoxy(44,20);cout<<r;delay(500);
  636.  
  637. gotoxy(26,22);
  638.  
  639. cout<<"EC";gotoxy(44,22);cout<<ec;delay(500);
  640.  
  641.  
  642.  
  643. }
  644.  
  645. void PERIODIC::INITIALISE(int a,char b[],char c[],float m,int d,int e,float x,float g,float h,char i[])
  646.  
  647. {
  648.  
  649. fstream f;
  650.  
  651. f.open("data.dat",ios::app|ios::binary);
  652.  
  653. if(f.fail())
  654.  
  655. { cerr<<"\nUnable to open the file";
  656.  
  657. getch();
  658.  
  659. exit(1);
  660.  
  661. }
  662.  
  663. z=a;
  664.  
  665. strcpy(name,b);
  666.  
  667. strcpy(sym,c) ;
  668.  
  669. mass=m;
  670.  
  671. grp=d;
  672.  
  673. prd=e;
  674.  
  675. bp=x;
  676.  
  677. rho=g;
  678.  
  679. r=h;
  680.  
  681. strcpy(ec,i);
  682.  
  683. f.write((char*)this,size);
  684.  
  685. f.close();
  686.  
  687. }
  688.  
  689. void DELETE()
  690.  
  691. { int num,k=1;
  692.  
  693. fstream f1,f2;
  694.  
  695. PERIODIC p;
  696.  
  697. f1.open("data.dat",ios::in|ios::binary);
  698.  
  699. if(f1.fail())
  700.  
  701. { cerr<<"\nUnable to open the file.";
  702.  
  703. getch();exit(1);
  704.  
  705. }
  706.  
  707. cout<<"\nEnter atomic number of the element you want to delete:";
  708.  
  709. cin>>num;
  710.  
  711. f2.open("naya.dat",ios::out|ios::binary);
  712.  
  713. if(f2.fail())
  714.  
  715. { cerr<<"\nUnable to open the file.";
  716.  
  717. getch();exit(1);
  718.  
  719. }
  720.  
  721. while(f1.read((char*)&p,size))
  722.  
  723. { if(p.Z()!=num)
  724.  
  725. {
  726.  
  727. f2.write((char*)&p,size);
  728.  
  729.  
  730.  
  731. }
  732.  
  733. if(p.Z()==num)
  734.  
  735. k=-1;
  736.  
  737. }
  738.  
  739. f1.close();
  740.  
  741. f2.close();
  742.  
  743.  
  744.  
  745. if(k!=-1)
  746.  
  747. cout<<"\nElement not found.";
  748.  
  749. else
  750.  
  751. cout<<" Element deleted.";
  752.  
  753. getch();
  754.  
  755. remove("data.dat");
  756.  
  757. rename("naya.dat","data.dat");
  758.  
  759. }
  760.  
  761. void MODIFY()
  762.  
  763. { clrscr();
  764.  
  765. fstream f;
  766.  
  767. SHOWDATE();
  768.  
  769. int a,num,k=0;
  770.  
  771. float mass,bp,r,rho;
  772.  
  773. int z,grp,prd;
  774.  
  775. char ch='n',name[50],ec[100],sym[3];
  776.  
  777. PERIODIC p;
  778.  
  779. f.open("data.dat",ios::in|ios::out|ios::binary);
  780.  
  781. if(f.fail())
  782.  
  783. { cerr<<"\nUnable to open the file";
  784.  
  785. getch();exit(1);
  786.  
  787. }
  788.  
  789. cout<<"\n\tENTER THE ATOMIC NO. OF THE ELEMENT YOU WANT TO MODIFY:";
  790.  
  791. cin>>a;
  792.  
  793. while(f.read((char*)&p,size))
  794.  
  795. {
  796.  
  797. if(p.Z()==a)
  798.  
  799. { k=1;
  800.  
  801. clrscr();
  802. SHOWDATE();
  803. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  804. for(int i=0;i<4;i++)
  805. { gotoxy(12,5+i);
  806. cout<<"||";
  807. gotoxy(18,5+i);
  808. cout<<"||";
  809. gotoxy(69,5+i);
  810. cout<<"||";
  811. gotoxy(74,5+i);
  812. cout<<"||";
  813.  
  814. }
  815. for(i=0;i<63;i++)
  816. { gotoxy(12+i,5);
  817. cout<<"==";
  818.  
  819. gotoxy(12+i,8);
  820. cout<<"==";
  821.  
  822. }
  823.  
  824.  
  825.  
  826. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"Do you want to modify atomic number(Y/N) ";
  827. gotoxy(72,6);
  828. cin>>ch;
  829. if(ch=='y'||ch=='Y')
  830. {
  831. for(i=0;i<63;i++)
  832. { gotoxy(12+i,5);
  833. cout<<"==";
  834. gotoxy(12+i,12);
  835. cout<<"==";
  836. }
  837. for(int i=0;i<8;i++)
  838. { gotoxy(12,5+i);
  839. cout<<"||";
  840. gotoxy(18,5+i);
  841. cout<<"||";
  842. gotoxy(69,5+i);
  843. cout<<"||";
  844. gotoxy(74,5+i);
  845. cout<<"||";
  846.  
  847. }
  848. gotoxy(14,10);
  849. cout<<"2.";
  850. gotoxy(21,10);
  851. cout<<"Enter atomic number";
  852. gotoxy(72,10);
  853. cin>>num;
  854. for(i=0;i<63;i++)
  855. { gotoxy(12+i,5);
  856. cout<<"==";
  857. gotoxy(12+i,12);
  858. cout<<"==";
  859. gotoxy(12+i,15);
  860. cout<<"==";
  861. }
  862. for(i=0;i<11;i++)
  863. { gotoxy(12,5+i);
  864. cout<<"||";
  865. gotoxy(18,5+i);
  866. cout<<"||";
  867. gotoxy(69,5+i);
  868. cout<<"||";
  869. gotoxy(74,5+i);
  870. cout<<"||";
  871.  
  872. }
  873. p.SETZ(num);
  874.  
  875. f.seekp(-size,ios::cur);
  876.  
  877. f.write((char*)&p,size);
  878. gotoxy(35,20);
  879. cout<<"Element modified";
  880.  
  881. getch();
  882.  
  883.  
  884. gotoxy(14,14);
  885. cout<<"3.";
  886. gotoxy(21,14);
  887. cout<<"continue()";
  888. gotoxy(72,14);
  889. cin>>ch;
  890. if(ch=='N'||ch=='n')
  891. {
  892. return;
  893. }
  894.  
  895. }
  896. clrscr();
  897. SHOWDATE();
  898. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  899. for( i=0;i<4;i++)
  900. { gotoxy(12,5+i);
  901. cout<<"||";
  902. gotoxy(18,5+i);
  903. cout<<"||";
  904. gotoxy(69,5+i);
  905. cout<<"||";
  906. gotoxy(74,5+i);
  907. cout<<"||";
  908.  
  909. }
  910. for(i=0;i<63;i++)
  911. { gotoxy(12+i,5);
  912. cout<<"==";
  913.  
  914. gotoxy(12+i,8);
  915. cout<<"==";
  916.  
  917. }
  918.  
  919.  
  920.  
  921. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY MASS NUMBER(Y/N)";
  922. gotoxy(72,6);
  923. cin>>ch;
  924. if(ch=='y'||ch=='Y')
  925. {
  926. for(i=0;i<63;i++)
  927. { gotoxy(12+i,5);
  928. cout<<"==";
  929. gotoxy(12+i,12);
  930. cout<<"==";
  931. }
  932. for( i=0;i<8;i++)
  933. { gotoxy(12,5+i);
  934. cout<<"||";
  935. gotoxy(18,5+i);
  936. cout<<"||";
  937. gotoxy(69,5+i);
  938. cout<<"||";
  939. gotoxy(74,5+i);
  940. cout<<"||";
  941.  
  942. }
  943. gotoxy(14,10);
  944. cout<<"2.";
  945. gotoxy(21,10);
  946. cout<<"ENTER MASS NUMBER";
  947. gotoxy(72,10);
  948. cin>>num;
  949. for(i=0;i<63;i++)
  950. { gotoxy(12+i,5);
  951. cout<<"==";
  952. gotoxy(12+i,12);
  953. cout<<"==";
  954. gotoxy(12+i,15);
  955. cout<<"==";
  956. }
  957. for(i=0;i<11;i++)
  958. { gotoxy(12,5+i);
  959. cout<<"||";
  960. gotoxy(18,5+i);
  961. cout<<"||";
  962. gotoxy(69,5+i);
  963. cout<<"||";
  964. gotoxy(74,5+i);
  965. cout<<"||";
  966.  
  967. }
  968. p.SETMASS(num);
  969.  
  970. f.seekp(-size,ios::cur);
  971.  
  972. f.write((char*)&p,size);
  973. gotoxy(35,20);
  974. cout<<"ELEMENT MODIFIED";
  975.  
  976. getch();
  977.  
  978.  
  979. gotoxy(14,14);
  980. cout<<"3.";
  981. gotoxy(21,14);
  982. cout<<"CONTINUE(Y/N)?";
  983. gotoxy(72,14);
  984. cin>>ch;
  985. if(ch=='N'||ch=='n')
  986. {
  987. return;
  988. }
  989.  
  990. }
  991.  
  992. clrscr();
  993. SHOWDATE();
  994. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  995. for(i=0;i<4;i++)
  996. { gotoxy(12,5+i);
  997. cout<<"||";
  998. gotoxy(18,5+i);
  999. cout<<"||";
  1000. gotoxy(69,5+i);
  1001. cout<<"||";
  1002. gotoxy(74,5+i);
  1003. cout<<"||";
  1004.  
  1005. }
  1006. for(i=0;i<63;i++)
  1007. { gotoxy(12+i,5);
  1008. cout<<"==";
  1009.  
  1010. gotoxy(12+i,8);
  1011. cout<<"==";
  1012.  
  1013. }
  1014.  
  1015.  
  1016.  
  1017. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY GROUP NUMBER(Y/N)";
  1018. gotoxy(72,6);
  1019. cin>>ch;
  1020. if(ch=='y'||ch=='Y')
  1021. {
  1022. for(i=0;i<63;i++)
  1023. { gotoxy(12+i,5);
  1024. cout<<"==";
  1025. gotoxy(12+i,12);
  1026. cout<<"==";
  1027. }
  1028. for( i=0;i<8;i++)
  1029. { gotoxy(12,5+i);
  1030. cout<<"||";
  1031. gotoxy(18,5+i);
  1032. cout<<"||";
  1033. gotoxy(69,5+i);
  1034. cout<<"||";
  1035. gotoxy(74,5+i);
  1036. cout<<"||";
  1037.  
  1038. }
  1039. gotoxy(14,10);
  1040. cout<<"2.";
  1041. gotoxy(21,10);
  1042. cout<<"ENTER GRUOP NUMBER";
  1043. gotoxy(72,10);
  1044. cin>>num;
  1045. for(i=0;i<63;i++)
  1046. { gotoxy(12+i,5);
  1047. cout<<"==";
  1048. gotoxy(12+i,12);
  1049. cout<<"==";
  1050. gotoxy(12+i,15);
  1051. cout<<"==";
  1052. }
  1053. for(i=0;i<11;i++)
  1054. { gotoxy(12,5+i);
  1055. cout<<"||";
  1056. gotoxy(18,5+i);
  1057. cout<<"||";
  1058. gotoxy(69,5+i);
  1059. cout<<"||";
  1060. gotoxy(74,5+i);
  1061. cout<<"||";
  1062.  
  1063. }
  1064. p.SETGROUP(num);
  1065.  
  1066. f.seekp(-size,ios::cur);
  1067.  
  1068. f.write((char*)&p,size);
  1069. gotoxy(35,20);
  1070. cout<<"ELEMENT MODIFIED";
  1071.  
  1072. getch();
  1073.  
  1074.  
  1075. gotoxy(14,14);
  1076. cout<<"3.";
  1077. gotoxy(21,14);
  1078. cout<<"CONTINUE(Y/N)?";
  1079. gotoxy(72,14);
  1080. cin>>ch;
  1081. if(ch=='N'||ch=='n')
  1082. {
  1083. return;
  1084. }
  1085.  
  1086. }
  1087. clrscr();
  1088. SHOWDATE();
  1089. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1090. for(i=0;i<4;i++)
  1091. { gotoxy(12,5+i);
  1092. cout<<"||";
  1093. gotoxy(18,5+i);
  1094. cout<<"||";
  1095. gotoxy(69,5+i);
  1096. cout<<"||";
  1097. gotoxy(74,5+i);
  1098. cout<<"||";
  1099.  
  1100. }
  1101. for(i=0;i<63;i++)
  1102. { gotoxy(12+i,5);
  1103. cout<<"==";
  1104.  
  1105. gotoxy(12+i,8);
  1106. cout<<"==";
  1107.  
  1108. }
  1109.  
  1110.  
  1111.  
  1112. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY PERIOD NUMBER(Y/N)";
  1113. gotoxy(72,6);
  1114. cin>>ch;
  1115. if(ch=='y'||ch=='Y')
  1116. {
  1117. for(i=0;i<63;i++)
  1118. { gotoxy(12+i,5);
  1119. cout<<"==";
  1120. gotoxy(12+i,12);
  1121. cout<<"==";
  1122. }
  1123. for(i=0;i<8;i++)
  1124. { gotoxy(12,5+i);
  1125. cout<<"||";
  1126. gotoxy(18,5+i);
  1127. cout<<"||";
  1128. gotoxy(69,5+i);
  1129. cout<<"||";
  1130. gotoxy(74,5+i);
  1131. cout<<"||";
  1132.  
  1133. }
  1134. gotoxy(14,10);
  1135. cout<<"2.";
  1136. gotoxy(21,10);
  1137. cout<<"ENTER PERIOD NUMBER";
  1138. gotoxy(72,10);
  1139. cin>>num;
  1140. for(i=0;i<63;i++)
  1141. { gotoxy(12+i,5);
  1142. cout<<"==";
  1143. gotoxy(12+i,12);
  1144. cout<<"==";
  1145. gotoxy(12+i,15);
  1146. cout<<"==";
  1147. }
  1148. for(i=0;i<11;i++)
  1149. { gotoxy(12,5+i);
  1150. cout<<"||";
  1151. gotoxy(18,5+i);
  1152. cout<<"||";
  1153. gotoxy(69,5+i);
  1154. cout<<"||";
  1155. gotoxy(74,5+i);
  1156. cout<<"||";
  1157.  
  1158. }
  1159. p.SETPERIOD(num);
  1160.  
  1161. f.seekp(-size,ios::cur);
  1162.  
  1163. f.write((char*)&p,size);
  1164. gotoxy(35,20);
  1165. cout<<"ELEMENT MODIFIED";
  1166.  
  1167. getch();
  1168.  
  1169.  
  1170. gotoxy(14,14);
  1171. cout<<"3.";
  1172. gotoxy(21,14);
  1173. cout<<"CONTINUE(Y/N)?";
  1174. gotoxy(72,14);
  1175. cin>>ch;
  1176. if(ch=='N'||ch=='n')
  1177. {
  1178. return;
  1179. }
  1180.  
  1181. }
  1182. clrscr();
  1183. SHOWDATE();
  1184. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1185. for(i=0;i<4;i++)
  1186. { gotoxy(12,5+i);
  1187. cout<<"||";
  1188. gotoxy(18,5+i);
  1189. cout<<"||";
  1190. gotoxy(69,5+i);
  1191. cout<<"||";
  1192. gotoxy(74,5+i);
  1193. cout<<"||";
  1194.  
  1195. }
  1196. for(i=0;i<63;i++)
  1197. { gotoxy(12+i,5);
  1198. cout<<"==";
  1199.  
  1200. gotoxy(12+i,8);
  1201. cout<<"==";
  1202.  
  1203. }
  1204.  
  1205.  
  1206.  
  1207. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY SYMBOL(Y/N)";
  1208. gotoxy(72,6);
  1209. cin>>ch;
  1210. if(ch=='y'||ch=='Y')
  1211. {
  1212. for(i=0;i<63;i++)
  1213. { gotoxy(12+i,5);
  1214. cout<<"==";
  1215. gotoxy(12+i,12);
  1216. cout<<"==";
  1217. }
  1218. for(int i=0;i<8;i++)
  1219. { gotoxy(12,5+i);
  1220. cout<<"||";
  1221. gotoxy(18,5+i);
  1222. cout<<"||";
  1223. gotoxy(69,5+i);
  1224. cout<<"||";
  1225. gotoxy(74,5+i);
  1226. cout<<"||";
  1227.  
  1228. }
  1229. gotoxy(14,10);
  1230. cout<<"2.";
  1231. gotoxy(21,10);
  1232. cout<<"ENTER SYMBOL";
  1233. gotoxy(72,10);
  1234. gets(sym);
  1235. for(i=0;i<63;i++)
  1236. { gotoxy(12+i,5);
  1237. cout<<"==";
  1238. gotoxy(12+i,12);
  1239. cout<<"==";
  1240. gotoxy(12+i,15);
  1241. cout<<"==";
  1242. }
  1243. for(i=0;i<11;i++)
  1244. { gotoxy(12,5+i);
  1245. cout<<"||";
  1246. gotoxy(18,5+i);
  1247. cout<<"||";
  1248. gotoxy(69,5+i);
  1249. cout<<"||";
  1250. gotoxy(74,5+i);
  1251. cout<<"||";
  1252.  
  1253. }
  1254. p.SETSYM(sym);
  1255.  
  1256. f.seekp(-size,ios::cur);
  1257.  
  1258. f.write((char*)&p,size);
  1259. gotoxy(35,20);
  1260. cout<<"ELEMENT MODIFIED";
  1261.  
  1262. getch();
  1263.  
  1264.  
  1265. gotoxy(14,14);
  1266. cout<<"3.";
  1267. gotoxy(21,14);
  1268. cout<<"CONTINUE(Y/N)?";
  1269. gotoxy(72,14);
  1270. cin>>ch;
  1271. if(ch=='N'||ch=='n')
  1272. {
  1273. return;
  1274. }
  1275.  
  1276. }
  1277. clrscr();
  1278. SHOWDATE();
  1279. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1280. for( i=0;i<4;i++)
  1281. { gotoxy(12,5+i);
  1282. cout<<"||";
  1283. gotoxy(18,5+i);
  1284. cout<<"||";
  1285. gotoxy(69,5+i);
  1286. cout<<"||";
  1287. gotoxy(74,5+i);
  1288. cout<<"||";
  1289.  
  1290. }
  1291. for(i=0;i<63;i++)
  1292. { gotoxy(12+i,5);
  1293. cout<<"==";
  1294.  
  1295. gotoxy(12+i,8);
  1296. cout<<"==";
  1297.  
  1298. }
  1299.  
  1300.  
  1301.  
  1302. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY EC(Y/N)";
  1303. gotoxy(72,6);
  1304. cin>>ch;
  1305. if(ch=='y'||ch=='Y')
  1306. {
  1307. for(i=0;i<63;i++)
  1308. { gotoxy(12+i,5);
  1309. cout<<"==";
  1310. gotoxy(12+i,12);
  1311. cout<<"==";
  1312. }
  1313. for(int i=0;i<8;i++)
  1314. { gotoxy(12,5+i);
  1315. cout<<"||";
  1316. gotoxy(18,5+i);
  1317. cout<<"||";
  1318. gotoxy(69,5+i);
  1319. cout<<"||";
  1320. gotoxy(74,5+i);
  1321. cout<<"||";
  1322.  
  1323. }
  1324. gotoxy(14,10);
  1325. cout<<"2.";
  1326. gotoxy(21,10);
  1327. cout<<"ENTER EC";
  1328. gotoxy(72,10);
  1329. gets(ec);
  1330. for(i=0;i<63;i++)
  1331. { gotoxy(12+i,5);
  1332. cout<<"==";
  1333. gotoxy(12+i,12);
  1334. cout<<"==";
  1335. gotoxy(12+i,15);
  1336. cout<<"==";
  1337. }
  1338. for(i=0;i<11;i++)
  1339. { gotoxy(12,5+i);
  1340. cout<<"||";
  1341. gotoxy(18,5+i);
  1342. cout<<"||";
  1343. gotoxy(69,5+i);
  1344. cout<<"||";
  1345. gotoxy(74,5+i);
  1346. cout<<"||";
  1347.  
  1348. }
  1349. p.SETEC(ec);
  1350.  
  1351. f.seekp(-size,ios::cur);
  1352.  
  1353. f.write((char*)&p,size);
  1354. gotoxy(35,20);
  1355. cout<<"ELEMENT MODIFIED";
  1356.  
  1357. getch();
  1358.  
  1359.  
  1360. gotoxy(14,14);
  1361. cout<<"3.";
  1362. gotoxy(21,14);
  1363. cout<<"CONTINUE(Y/N)?";
  1364. gotoxy(72,14);
  1365. cin>>ch;
  1366. if(ch=='n'||ch=='N')
  1367. {
  1368. return;
  1369. }
  1370.  
  1371. }
  1372. clrscr();
  1373. SHOWDATE();
  1374. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1375. for(i=0;i<4;i++)
  1376. { gotoxy(12,5+i);
  1377. cout<<"||";
  1378. gotoxy(18,5+i);
  1379. cout<<"||";
  1380. gotoxy(69,5+i);
  1381. cout<<"||";
  1382. gotoxy(74,5+i);
  1383. cout<<"||";
  1384.  
  1385. }
  1386. for(i=0;i<63;i++)
  1387. { gotoxy(12+i,5);
  1388. cout<<"==";
  1389.  
  1390. gotoxy(12+i,8);
  1391. cout<<"==";
  1392.  
  1393. }
  1394.  
  1395.  
  1396.  
  1397. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY BOILING POINT(Y/N)";
  1398. gotoxy(72,6);
  1399. cin>>ch;
  1400. if(ch=='y'||ch=='Y')
  1401. {
  1402. for(i=0;i<63;i++)
  1403. { gotoxy(12+i,5);
  1404. cout<<"==";
  1405. gotoxy(12+i,12);
  1406. cout<<"==";
  1407. }
  1408. for(int i=0;i<8;i++)
  1409. { gotoxy(12,5+i);
  1410. cout<<"||";
  1411. gotoxy(18,5+i);
  1412. cout<<"||";
  1413. gotoxy(69,5+i);
  1414. cout<<"||";
  1415. gotoxy(74,5+i);
  1416. cout<<"||";
  1417.  
  1418. }
  1419. gotoxy(14,10);
  1420. cout<<"2.";
  1421. gotoxy(21,10);
  1422. cout<<"ENTER BOILING POINT";
  1423. gotoxy(72,10);
  1424. cin>>bp;
  1425. for(i=0;i<63;i++)
  1426. { gotoxy(12+i,5);
  1427. cout<<"==";
  1428. gotoxy(12+i,12);
  1429. cout<<"==";
  1430. gotoxy(12+i,15);
  1431. cout<<"==";
  1432. }
  1433. for(i=0;i<11;i++)
  1434. { gotoxy(12,5+i);
  1435. cout<<"||";
  1436. gotoxy(18,5+i);
  1437. cout<<"||";
  1438. gotoxy(69,5+i);
  1439. cout<<"||";
  1440. gotoxy(74,5+i);
  1441. cout<<"||";
  1442.  
  1443. }
  1444. p.SETBP(bp);
  1445.  
  1446. f.seekp(-size,ios::cur);
  1447.  
  1448. f.write((char*)&p,size);
  1449. gotoxy(35,20);
  1450. cout<<"ELEMENT MODIFIED";
  1451.  
  1452. getch();
  1453.  
  1454.  
  1455. gotoxy(14,14);
  1456. cout<<"3.";
  1457. gotoxy(21,14);
  1458. cout<<"CONTINUE(Y/N)?";
  1459. gotoxy(72,14);
  1460. cin>>ch;
  1461. if(ch=='n'||ch=='N')
  1462. {
  1463. return;
  1464. }
  1465.  
  1466. }
  1467. clrscr();
  1468. SHOWDATE();
  1469. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1470. for(i=0;i<4;i++)
  1471. { gotoxy(12,5+i);
  1472. cout<<"||";
  1473. gotoxy(18,5+i);
  1474. cout<<"||";
  1475. gotoxy(69,5+i);
  1476. cout<<"||";
  1477. gotoxy(74,5+i);
  1478. cout<<"||";
  1479.  
  1480. }
  1481. for(i=0;i<63;i++)
  1482. { gotoxy(12+i,5);
  1483. cout<<"==";
  1484.  
  1485. gotoxy(12+i,8);
  1486. cout<<"==";
  1487.  
  1488. }
  1489.  
  1490.  
  1491.  
  1492. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY ATOMIC RADIUS(Y/N)";
  1493. gotoxy(72,6);
  1494. cin>>ch;
  1495. if(ch=='y'||ch=='Y')
  1496. {
  1497. for(i=0;i<63;i++)
  1498. { gotoxy(12+i,5);
  1499. cout<<"==";
  1500. gotoxy(12+i,12);
  1501. cout<<"==";
  1502. }
  1503. for(int i=0;i<8;i++)
  1504. { gotoxy(12,5+i);
  1505. cout<<"||";
  1506. gotoxy(18,5+i);
  1507. cout<<"||";
  1508. gotoxy(69,5+i);
  1509. cout<<"||";
  1510. gotoxy(74,5+i);
  1511. cout<<"||";
  1512.  
  1513. }
  1514. gotoxy(14,10);
  1515. cout<<"2.";
  1516. gotoxy(21,10);
  1517. cout<<"ENTER ATOMIC RADIUS";
  1518. gotoxy(72,10);
  1519. cin>>r;
  1520. for(i=0;i<63;i++)
  1521. { gotoxy(12+i,5);
  1522. cout<<"==";
  1523. gotoxy(12+i,12);
  1524. cout<<"==";
  1525. gotoxy(12+i,15);
  1526. cout<<"==";
  1527. }
  1528. for(i=0;i<11;i++)
  1529. { gotoxy(12,5+i);
  1530. cout<<"||";
  1531. gotoxy(18,5+i);
  1532. cout<<"||";
  1533. gotoxy(69,5+i);
  1534. cout<<"||";
  1535. gotoxy(74,5+i);
  1536. cout<<"||";
  1537.  
  1538. }
  1539. p.SETR(r);
  1540.  
  1541. f.seekp(-size,ios::cur);
  1542.  
  1543. f.write((char*)&p,size);
  1544. gotoxy(35,20);
  1545. cout<<"ELEMENT MODIFIED";
  1546.  
  1547. getch();
  1548.  
  1549.  
  1550. gotoxy(14,14);
  1551. cout<<"3.";
  1552. gotoxy(21,14);
  1553. cout<<"CONTINUE(Y/N)?";
  1554. gotoxy(72,14);
  1555. cin>>ch;
  1556. if(ch=='n'||ch=='N')
  1557. {
  1558. return;
  1559. }
  1560.  
  1561. }
  1562. clrscr();
  1563. SHOWDATE();
  1564. gotoxy(37,4);cout<<"MODIFICATION WINDOW";
  1565. for(i=0;i<4;i++)
  1566. { gotoxy(12,5+i);
  1567. cout<<"||";
  1568. gotoxy(18,5+i);
  1569. cout<<"||";
  1570. gotoxy(69,5+i);
  1571. cout<<"||";
  1572. gotoxy(74,5+i);
  1573. cout<<"||";
  1574.  
  1575. }
  1576. for(i=0;i<63;i++)
  1577. { gotoxy(12+i,5);
  1578. cout<<"==";
  1579.  
  1580. gotoxy(12+i,8);
  1581. cout<<"==";
  1582.  
  1583. }
  1584.  
  1585.  
  1586.  
  1587. gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY DENSITY(Y/N)";
  1588. gotoxy(72,6);
  1589. cin>>ch;
  1590. if(ch=='y'||ch=='Y')
  1591. {
  1592. for(i=0;i<63;i++)
  1593. { gotoxy(12+i,5);
  1594. cout<<"==";
  1595. gotoxy(12+i,12);
  1596. cout<<"==";
  1597. }
  1598. for(int i=0;i<8;i++)
  1599. { gotoxy(12,5+i);
  1600. cout<<"||";
  1601. gotoxy(18,5+i);
  1602. cout<<"||";
  1603. gotoxy(69,5+i);
  1604. cout<<"||";
  1605. gotoxy(74,5+i);
  1606. cout<<"||";
  1607.  
  1608. }
  1609. gotoxy(14,10);
  1610. cout<<"2.";
  1611. gotoxy(21,10);
  1612. cout<<"ENTER DENSITY";
  1613. gotoxy(72,10);
  1614. cin>>num;
  1615. for(i=0;i<63;i++)
  1616. { gotoxy(12+i,5);
  1617. cout<<"==";
  1618. gotoxy(12+i,12);
  1619. cout<<"==";
  1620. gotoxy(12+i,15);
  1621. cout<<"==";
  1622. }
  1623. for(i=0;i<11;i++)
  1624. { gotoxy(12,5+i);
  1625. cout<<"||";
  1626. gotoxy(18,5+i);
  1627. cout<<"||";
  1628. gotoxy(69,5+i);
  1629. cout<<"||";
  1630. gotoxy(74,5+i);
  1631. cout<<"||";
  1632.  
  1633. }
  1634. p.SETRHO(rho);
  1635.  
  1636. f.seekp(-size,ios::cur);
  1637.  
  1638. f.write((char*)&p,size);
  1639. gotoxy(35,20);
  1640. cout<<"ELEMENT MODIFIED";
  1641.  
  1642. getch();
  1643.  
  1644.  
  1645. gotoxy(14,14);
  1646. cout<<"3.";
  1647. gotoxy(21,14);
  1648. cout<<"CONTINUE(Y/N)?";
  1649. gotoxy(72,14);
  1650. cin>>ch;
  1651. if(ch=='n'||ch=='N')
  1652. {
  1653. return;
  1654. }
  1655.  
  1656. }
  1657.  
  1658. }
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664. }
  1665.  
  1666. if(k==0)
  1667.  
  1668. { gotoxy(26,20);
  1669. cout<<"Element not found.";
  1670.  
  1671. getch();return;
  1672.  
  1673. }
  1674.  
  1675. f.close();
  1676.  
  1677. }
  1678. void TABLE1()
  1679. { clrscr();
  1680. SHOWDATE();
  1681. for(int i=0;i<50;i++)
  1682. {
  1683. gotoxy(20+i,9);
  1684. cout<<"==";
  1685. gotoxy(20+i,11);
  1686. cout<<"==";
  1687. }
  1688. for(i=0;i<1;i++)
  1689. {
  1690. gotoxy(20,10+i);cout<<"|";
  1691. gotoxy(60,10+i);cout<<"|";
  1692. gotoxy(70,10+i);cout<<"|";
  1693. }
  1694.  
  1695. gotoxy(22,10);
  1696. cout<<"ENTER THE ATOMIC NUMBER OF ELEMENT";
  1697.  
  1698. }
  1699. void CBP()
  1700.  
  1701. { int a1,a2,i=0,j=0; float x,y;
  1702. clrscr();
  1703. SHOWDATE();
  1704. PERIODIC p1,p2;
  1705.  
  1706. char n1[50],n2[50];
  1707.  
  1708. fstream f;
  1709.  
  1710. f.open("data.dat",ios::in|ios::binary);
  1711.  
  1712. if(f.fail())
  1713.  
  1714. { cerr<<"\nUnable to open the file";
  1715.  
  1716. getch();exit(1);
  1717.  
  1718. }
  1719.  
  1720. L:
  1721. gotoxy(37,4);
  1722. for(int z=0;z<5;z++)
  1723. {
  1724. gotoxy(37,4);
  1725. delay(500);
  1726. cout<<"FOR ELEMENT 1";
  1727. delay(500);
  1728. gotoxy(37,4);
  1729. cout<<" ";
  1730. }
  1731. TABLE1();
  1732. gotoxy(37,4);
  1733. cout<<"FOR ELEMENT 1";
  1734. gotoxy(65,10);
  1735. cin>>a1;
  1736.  
  1737. clrscr();
  1738. SHOWDATE();
  1739. for(z=0;z<5;z++)
  1740. { delay(500);
  1741. gotoxy(37,4);
  1742. cout<<"FOR ELEMENT 2";
  1743. delay(500);
  1744. gotoxy(37,4);
  1745. cout<<" ";
  1746. }
  1747. TABLE1();
  1748. gotoxy(37,4);
  1749. cout<<"FOR ELEMENT 2";
  1750. gotoxy(65,10);
  1751.  
  1752. cin>>a2;
  1753.  
  1754. while(f.read((char*)&p1,size))
  1755.  
  1756. {
  1757.  
  1758. if(p1.Z()==a1)
  1759.  
  1760. { x=p1.BP();
  1761.  
  1762. strcpy(n1,p1.NAME());
  1763.  
  1764. i=1;
  1765.  
  1766.  
  1767.  
  1768. }
  1769.  
  1770. if(p1.Z()==a2)
  1771.  
  1772. { y=p1.BP();
  1773.  
  1774. strcpy(n2,p1.NAME());
  1775.  
  1776. j=1;
  1777.  
  1778.  
  1779.  
  1780. }
  1781.  
  1782.  
  1783.  
  1784. }
  1785.  
  1786. if(i==0||j==0)
  1787.  
  1788. { for(i=0;i<30;i++)
  1789. {
  1790. gotoxy(24+i,14);
  1791. cout<<"==";
  1792. gotoxy(24+i,16);
  1793. cout<<"==";
  1794. }
  1795. for(i=0;i<1;i++)
  1796. {
  1797. gotoxy(24,15+i);cout<<"|";
  1798. gotoxy(54,15+i);cout<<"|";
  1799. }
  1800.  
  1801. gotoxy(26,15);
  1802. cout<<"ELEMENTS DO NOT EXIST";
  1803. gotoxy(51,15);
  1804. getch();
  1805. return;
  1806.  
  1807.  
  1808.  
  1809.  
  1810. }
  1811.  
  1812. clrscr();
  1813. SHOWDATE();
  1814. gotoxy(36,4);cout<<"COMPARISION";
  1815. for( i=0;i<10;i++)
  1816. { gotoxy(12,5+i);
  1817. cout<<"||";
  1818. gotoxy(40,5+i);
  1819. cout<<"||";
  1820. gotoxy(70,5+i);
  1821. cout<<"||";
  1822. }
  1823. for(i=0;i<59;i++)
  1824. { gotoxy(12+i,5);
  1825. cout<<"==";
  1826. gotoxy(12+i,15);
  1827. cout<<"==";
  1828. gotoxy(12+i,8);
  1829. cout<<"==";
  1830. gotoxy(12+i,12);
  1831. cout<<"==";
  1832. }
  1833. gotoxy(5,6);
  1834. cout<<"NAME";
  1835. gotoxy(2,10);
  1836. cout<<"ATOMIC NO.";
  1837. gotoxy(1,13);
  1838. cout<<" BOILING";
  1839. gotoxy(1,14);
  1840. cout<<" POINT";
  1841.  
  1842.  
  1843. gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
  1844. gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
  1845. gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
  1846.  
  1847. for(i=0;i<50;i++)
  1848. {
  1849. gotoxy(15+i,19);
  1850. cout<<"==";
  1851. gotoxy(15+i,21);
  1852. cout<<"==";
  1853. }
  1854. for(i=0;i<1;i++)
  1855. {
  1856. gotoxy(15,20+i);cout<<"|";
  1857. gotoxy(47,20+i);cout<<"|";
  1858. gotoxy(65,20+i);cout<<"|";
  1859. gotoxy(35,20+i);cout<<"|";
  1860.  
  1861. }
  1862.  
  1863. gotoxy(25,20);
  1864. cout<<x;
  1865. gotoxy(51,20);
  1866. cout<<y;
  1867. gotoxy(41,20);
  1868.  
  1869. if(x>y)
  1870.  
  1871. {
  1872. cout<<">";
  1873. }
  1874.  
  1875. else if(y>x)
  1876.  
  1877. {
  1878. cout<<"<";
  1879. }
  1880.  
  1881. else
  1882.  
  1883. {
  1884. cout<<"=";
  1885. }
  1886.  
  1887.  
  1888. f.close();
  1889.  
  1890. getch();
  1891.  
  1892. }
  1893.  
  1894. void CAM()
  1895.  
  1896. { int a1,a2,i=0,j=0;float x,y;
  1897.  
  1898. char n1[50],n2[50];
  1899. clrscr();
  1900. SHOWDATE();
  1901.  
  1902. PERIODIC p1,p2;
  1903.  
  1904. fstream f;
  1905.  
  1906. f.open("data.dat",ios::in|ios::binary);
  1907.  
  1908. if(f.fail())
  1909.  
  1910. { cerr<<"\nUnable to open the file";
  1911.  
  1912. getch();exit(1);
  1913.  
  1914. }
  1915.  
  1916. L:
  1917.  
  1918. gotoxy(37,4);
  1919. for(int z=0;z<5;z++)
  1920. {
  1921. gotoxy(37,4);
  1922. delay(500);
  1923. cout<<"FOR ELEMENT 1";
  1924. delay(500);
  1925. gotoxy(37,4);
  1926. cout<<" ";
  1927. }
  1928. TABLE1();
  1929. gotoxy(37,4);
  1930. cout<<"FOR ELEMENT 1";
  1931. gotoxy(65,10);
  1932. cin>>a1;
  1933.  
  1934. clrscr();
  1935. SHOWDATE();
  1936. for(z=0;z<5;z++)
  1937. { delay(500);
  1938. gotoxy(37,4);
  1939. cout<<"FOR ELEMENT 2";
  1940. delay(500);
  1941. gotoxy(37,4);
  1942. cout<<" ";
  1943. }
  1944. TABLE1();
  1945. gotoxy(37,4);
  1946. cout<<"FOR ELEMENT 2";
  1947. gotoxy(65,10);
  1948.  
  1949. cin>>a2;
  1950. while(f.read((char*)&p1,size))
  1951.  
  1952. {
  1953.  
  1954. if(p1.Z()==a1)
  1955.  
  1956. { x=p1.MASS();
  1957.  
  1958. strcpy(n1,p1.NAME());
  1959.  
  1960. i=1;
  1961.  
  1962.  
  1963.  
  1964. }
  1965.  
  1966. if(p1.Z()==a2)
  1967.  
  1968. { y=p1.MASS();
  1969.  
  1970. strcpy(n2,p1.NAME());
  1971.  
  1972. j=1;
  1973.  
  1974.  
  1975.  
  1976. }
  1977.  
  1978.  
  1979.  
  1980. }
  1981.  
  1982. if(i==0||j==0)
  1983.  
  1984. { for(i=0;i<30;i++)
  1985. {
  1986. gotoxy(24+i,14);
  1987. cout<<"==";
  1988. gotoxy(24+i,16);
  1989. cout<<"==";
  1990. }
  1991. for(i=0;i<1;i++)
  1992. {
  1993. gotoxy(24,15+i);cout<<"|";
  1994. gotoxy(54,15+i);cout<<"|";
  1995. }
  1996.  
  1997. gotoxy(26,15);
  1998. cout<<"ELEMENTS DO NOT EXIST";
  1999. gotoxy(51,15);
  2000. getch();
  2001. return;
  2002.  
  2003.  
  2004.  
  2005.  
  2006. }
  2007.  
  2008. clrscr();
  2009. SHOWDATE();
  2010. gotoxy(36,4);cout<<"COMPARISION";
  2011. for( i=0;i<10;i++)
  2012. { gotoxy(12,5+i);
  2013. cout<<"||";
  2014. gotoxy(40,5+i);
  2015. cout<<"||";
  2016. gotoxy(70,5+i);
  2017. cout<<"||";
  2018. }
  2019. for(i=0;i<59;i++)
  2020. { gotoxy(12+i,5);
  2021. cout<<"==";
  2022. gotoxy(12+i,15);
  2023. cout<<"==";
  2024. gotoxy(12+i,8);
  2025. cout<<"==";
  2026. gotoxy(12+i,12);
  2027. cout<<"==";
  2028. }
  2029. gotoxy(5,6);
  2030. cout<<"NAME";
  2031. gotoxy(2,10);
  2032. cout<<"ATOMIC NO.";
  2033. gotoxy(1,13);
  2034. cout<<" ATOMIC";
  2035. gotoxy(1,14);
  2036. cout<<"MASS";
  2037.  
  2038.  
  2039. gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
  2040. gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
  2041. gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
  2042.  
  2043. for(i=0;i<50;i++)
  2044. {
  2045. gotoxy(15+i,19);
  2046. cout<<"==";
  2047. gotoxy(15+i,21);
  2048. cout<<"==";
  2049. }
  2050. for(i=0;i<1;i++)
  2051. {
  2052. gotoxy(15,20+i);cout<<"|";
  2053. gotoxy(47,20+i);cout<<"|";
  2054. gotoxy(65,20+i);cout<<"|";
  2055. gotoxy(35,20+i);cout<<"|";
  2056.  
  2057. }
  2058.  
  2059. gotoxy(25,20);
  2060. cout<<x;
  2061. gotoxy(51,20);
  2062. cout<<y;
  2063. gotoxy(41,20);
  2064.  
  2065. if(x>y)
  2066.  
  2067. {
  2068. cout<<">";
  2069. }
  2070.  
  2071. else if(y>x)
  2072.  
  2073. {
  2074. cout<<"<";
  2075. }
  2076.  
  2077. else
  2078.  
  2079. {
  2080. cout<<"=";
  2081. }
  2082.  
  2083. f.close();
  2084.  
  2085. getch();
  2086.  
  2087. }
  2088.  
  2089.  
  2090. void CAR()
  2091.  
  2092. { clrscr();
  2093. SHOWDATE();
  2094.  
  2095. int a1,a2,i=0,j=0; float x,y;
  2096.  
  2097. char n1[50],n2[50];
  2098.  
  2099. PERIODIC p1,p2;
  2100.  
  2101. fstream f;
  2102.  
  2103. f.open("data.dat",ios::in|ios::binary);
  2104.  
  2105. if(f.fail())
  2106.  
  2107. { cerr<<"\nUnable to open the file";
  2108.  
  2109. getch();exit(1);
  2110.  
  2111. }
  2112.  
  2113. L:
  2114. gotoxy(37,4);
  2115. for(int z=0;z<5;z++)
  2116. {
  2117. gotoxy(37,4);
  2118. delay(500);
  2119. cout<<"FOR ELEMENT 1";
  2120. delay(500);
  2121. gotoxy(37,4);
  2122. cout<<" ";
  2123. }
  2124. TABLE1();
  2125. gotoxy(37,4);
  2126. cout<<"FOR ELEMENT 1";
  2127. gotoxy(65,10);
  2128. cin>>a1;
  2129.  
  2130. clrscr();
  2131. SHOWDATE();
  2132. for(z=0;z<5;z++)
  2133. { delay(500);
  2134. gotoxy(37,4);
  2135. cout<<"FOR ELEMENT 2";
  2136. delay(500);
  2137. gotoxy(37,4);
  2138. cout<<" ";
  2139. }
  2140. TABLE1();
  2141. gotoxy(37,4);
  2142. cout<<"FOR ELEMENT 2";
  2143. gotoxy(65,10);
  2144.  
  2145. cin>>a2;
  2146.  
  2147. while(f.read((char*)&p1,size))
  2148.  
  2149. {
  2150.  
  2151. if(p1.Z()==a1)
  2152.  
  2153. { x=p1.R();
  2154.  
  2155. strcpy(n1,p1.NAME());
  2156.  
  2157. i=1;
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163. }
  2164.  
  2165. if(p1.Z()==a2)
  2166.  
  2167. { y=p1.R();
  2168.  
  2169. strcpy(n2,p1.NAME());
  2170.  
  2171. j=1;
  2172.  
  2173.  
  2174.  
  2175. }
  2176.  
  2177.  
  2178.  
  2179. }
  2180.  
  2181. if(i==0||j==0)
  2182.  
  2183. { for(i=0;i<30;i++)
  2184. {
  2185. gotoxy(24+i,14);
  2186. cout<<"==";
  2187. gotoxy(24+i,16);
  2188. cout<<"==";
  2189. }
  2190. for(i=0;i<1;i++)
  2191. {
  2192. gotoxy(24,15+i);cout<<"|";
  2193. gotoxy(54,15+i);cout<<"|";
  2194. }
  2195.  
  2196. gotoxy(26,15);
  2197. cout<<"ELEMENTS DO NOT EXIST";
  2198. gotoxy(51,15);
  2199. getch();
  2200. return;
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206. }
  2207. clrscr();
  2208. SHOWDATE();
  2209. gotoxy(36,4);cout<<"COMPARISION";
  2210. for( i=0;i<10;i++)
  2211. { gotoxy(12,5+i);
  2212. cout<<"||";
  2213. gotoxy(40,5+i);
  2214. cout<<"||";
  2215. gotoxy(70,5+i);
  2216. cout<<"||";
  2217. }
  2218. for(i=0;i<59;i++)
  2219. { gotoxy(12+i,5);
  2220. cout<<"==";
  2221. gotoxy(12+i,15);
  2222. cout<<"==";
  2223. gotoxy(12+i,8);
  2224. cout<<"==";
  2225. gotoxy(12+i,12);
  2226. cout<<"==";
  2227. }
  2228. gotoxy(5,6);
  2229. cout<<"NAME";
  2230. gotoxy(2,10);
  2231. cout<<"ATOMIC NO.";
  2232. gotoxy(1,13);
  2233. cout<<" ATOMIC";
  2234. gotoxy(1,14);
  2235. cout<<" RADII";
  2236.  
  2237.  
  2238. gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
  2239. gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
  2240. gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
  2241.  
  2242. for(i=0;i<50;i++)
  2243. {
  2244. gotoxy(15+i,19);
  2245. cout<<"==";
  2246. gotoxy(15+i,21);
  2247. cout<<"==";
  2248. }
  2249. for(i=0;i<1;i++)
  2250. {
  2251. gotoxy(15,20+i);cout<<"|";
  2252. gotoxy(47,20+i);cout<<"|";
  2253. gotoxy(65,20+i);cout<<"|";
  2254. gotoxy(35,20+i);cout<<"|";
  2255.  
  2256. }
  2257.  
  2258. gotoxy(25,20);
  2259. cout<<x;
  2260. gotoxy(51,20);
  2261. cout<<y;
  2262. gotoxy(41,20);
  2263.  
  2264. if(x>y)
  2265.  
  2266. {
  2267. cout<<">";
  2268. }
  2269.  
  2270. else if(y>x)
  2271.  
  2272. {
  2273. cout<<"<";
  2274. }
  2275.  
  2276. else
  2277.  
  2278. {
  2279. cout<<"=";
  2280. }
  2281.  
  2282. f.close();
  2283.  
  2284. getch();
  2285.  
  2286. }
  2287.  
  2288. void COMPARE()
  2289.  
  2290. { int n;
  2291.  
  2292. L:
  2293.  
  2294. clrscr();
  2295. SHOWDATE();
  2296. gotoxy(37,4);cout<<"COMPARE MENU";
  2297. for(int i=0;i<10;i++)
  2298. { gotoxy(12,5+i);
  2299. cout<<"||";
  2300. gotoxy(18,5+i);
  2301. cout<<"||";
  2302. gotoxy(70,5+i);
  2303. cout<<"||";
  2304. }
  2305. for(i=0;i<59;i++)
  2306. { gotoxy(12+i,5);
  2307. cout<<"==";
  2308. gotoxy(12+i,15);
  2309. cout<<"==";
  2310. gotoxy(12+i,8);
  2311. cout<<"==";
  2312. gotoxy(12+i,12);
  2313. cout<<"==";
  2314. }
  2315.  
  2316.  
  2317.  
  2318. gotoxy(15,6);cout<<"1.";gotoxy(24,6);cout<<"TO COMAPRE ON THE BASIS OF BOILING POINT";
  2319. gotoxy(15,10);cout<<"2.";gotoxy(24,10);cout<<"TO COMPARE ON THE BASIS OF ATOMIC MASS";
  2320. gotoxy(15,14);cout<<"3.";gotoxy(24,14);cout<<"TO COMPARE ON THE BASIS OF ATOMIC RADII";
  2321.  
  2322. for(i=0;i<30;i++)
  2323. {
  2324. gotoxy(24+i,19);
  2325. cout<<"==";
  2326. gotoxy(24+i,21);
  2327. cout<<"==";
  2328. }
  2329. for(i=0;i<1;i++)
  2330. {
  2331. gotoxy(24,20+i);cout<<"|";
  2332. gotoxy(49,20+i);cout<<"|";
  2333. gotoxy(54,20+i);cout<<"|";
  2334. }
  2335.  
  2336. gotoxy(26,20);
  2337. cout<<"ENTER YOUR CHOICE";
  2338. gotoxy(51,20);
  2339.  
  2340. cin>>n;
  2341.  
  2342. switch(n)
  2343.  
  2344. { case 1:CBP();break;
  2345.  
  2346. case 2:CAM();break;
  2347.  
  2348. case 3:CAR();break;
  2349.  
  2350.  
  2351.  
  2352. default:{ for(i=0;i<30;i++)
  2353. {
  2354. gotoxy(24+i,14);
  2355. cout<<"==";
  2356. gotoxy(24+i,16);
  2357. cout<<"==";
  2358. }
  2359. for(i=0;i<1;i++)
  2360. {
  2361. gotoxy(24,15+i);cout<<"|";
  2362. gotoxy(54,15+i);cout<<"|";
  2363. }
  2364.  
  2365. gotoxy(26,15);
  2366. cout<<"PLEASE PROVIDE A VALID INPUT";
  2367. gotoxy(51,15);
  2368. getch();
  2369.  
  2370.  
  2371. goto L;
  2372.  
  2373. }
  2374.  
  2375. }
  2376.  
  2377. }
  2378.  
  2379. void SEARCHBYNAME()
  2380.  
  2381. { fstream f;
  2382.  
  2383. int flag=1;
  2384. clrscr();
  2385. PERIODIC p;
  2386. SHOWDATE();
  2387. char str[40],ch[40];
  2388.  
  2389. f.open("data.dat",ios::in|ios::binary);
  2390.  
  2391. f.seekg(0,ios::beg);
  2392.  
  2393. if(f.fail())
  2394.  
  2395. { cerr<<"\nUnable to open the file.";
  2396.  
  2397. getch();exit(1);
  2398.  
  2399. }
  2400. for(int i=0;i<40;i++)
  2401. {
  2402. gotoxy(24+i,9);
  2403. cout<<"==";
  2404. gotoxy(24+i,11);
  2405. cout<<"==";
  2406. }
  2407. for(i=0;i<1;i++)
  2408. {
  2409. gotoxy(24,10+i);cout<<"|";
  2410. gotoxy(49,10+i);cout<<"|";
  2411.  
  2412. }
  2413.  
  2414. gotoxy(26,10);
  2415. cout<<"ENTER THE NAME";
  2416. gotoxy(51,10);
  2417.  
  2418. gets(ch);
  2419.  
  2420. while(f.read((char*)&p,size))
  2421.  
  2422. {
  2423.  
  2424. strcpy(str,p.NAME());
  2425.  
  2426. if(strcmpi(str,ch)==0)
  2427.  
  2428. { p.SINGLEOUT();flag=0;
  2429.  
  2430.  
  2431.  
  2432. }
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438. }
  2439.  
  2440. if(flag!=0)
  2441. {
  2442. for(i=0;i<30;i++)
  2443. {
  2444. gotoxy(24+i,14);
  2445. cout<<"==";
  2446. gotoxy(24+i,16);
  2447. cout<<"==";
  2448. }
  2449. for(i=0;i<1;i++)
  2450. {
  2451. gotoxy(24,15+i);cout<<"|";
  2452. gotoxy(54,15+i);cout<<"|";
  2453. }
  2454.  
  2455. gotoxy(26,15);
  2456. cout<<" ELEMENT NOT FOUND!!";
  2457. gotoxy(51,15);
  2458. }
  2459. f.close();
  2460.  
  2461. getch();
  2462.  
  2463. }
  2464.  
  2465. void SEARCHBYS()
  2466.  
  2467. { fstream f;
  2468. clrscr();
  2469. int flag=1;
  2470. SHOWDATE();
  2471. PERIODIC p;
  2472.  
  2473. char str[4],ch[4];
  2474.  
  2475. f.open("data.dat",ios::in|ios::binary);
  2476.  
  2477.  
  2478.  
  2479. if(f.fail())
  2480.  
  2481. { cerr<<"\nUnable to open the file.";
  2482.  
  2483. getch();exit(1);
  2484.  
  2485. }
  2486. for(int i=0;i<30;i++)
  2487. {
  2488. gotoxy(24+i,9);
  2489. cout<<"==";
  2490. gotoxy(24+i,11);
  2491. cout<<"==";
  2492. }
  2493. for(i=0;i<1;i++)
  2494. {
  2495. gotoxy(24,10+i);cout<<"|";
  2496. gotoxy(49,10+i);cout<<"|";
  2497. gotoxy(54,10+i);cout<<"|";
  2498. }
  2499.  
  2500. gotoxy(26,10);
  2501. cout<<"ENTER THE SYMBOL";
  2502. gotoxy(51,10);
  2503.  
  2504. gets(ch);
  2505.  
  2506.  
  2507.  
  2508. f.seekg(0,ios::beg);
  2509.  
  2510. while(f.read((char*)&p,size))
  2511.  
  2512. {
  2513.  
  2514. p.SYM(str);
  2515.  
  2516. if(strcmpi(str,ch)==0)
  2517.  
  2518. { p.SINGLEOUT();flag=0;
  2519.  
  2520. }
  2521.  
  2522. }
  2523.  
  2524. if(flag!=0)
  2525. { for(i=0;i<30;i++)
  2526. {
  2527. gotoxy(24+i,14);
  2528. cout<<"==";
  2529. gotoxy(24+i,16);
  2530. cout<<"==";
  2531. }
  2532. for(i=0;i<1;i++)
  2533. {
  2534. gotoxy(24,15+i);cout<<"|";
  2535. gotoxy(54,15+i);cout<<"|";
  2536. }
  2537.  
  2538. gotoxy(26,15);
  2539. cout<<" ELEMENT NOT FOUND!!";
  2540. gotoxy(51,15);
  2541.  
  2542. }
  2543. f.close();
  2544.  
  2545. getch();
  2546.  
  2547. }
  2548.  
  2549. void SEARCHBYZ()
  2550.  
  2551. { fstream f; PERIODIC p;
  2552. clrscr();
  2553. int n,s,flag=1;
  2554. SHOWDATE();
  2555. f.open("data.dat",ios::in|ios::binary);
  2556.  
  2557. if(f.fail())
  2558.  
  2559. { cerr<<"\nUnable to open the file";
  2560.  
  2561. getch();exit(1);
  2562.  
  2563. }
  2564.  
  2565. f.seekg(0,ios::beg);
  2566.  
  2567. for(int i=0;i<30;i++)
  2568. {
  2569. gotoxy(24+i,9);
  2570. cout<<"==";
  2571. gotoxy(24+i,11);
  2572. cout<<"==";
  2573. }
  2574. for(i=0;i<1;i++)
  2575. {
  2576. gotoxy(24,10+i);cout<<"|";
  2577. gotoxy(49,10+i);cout<<"|";
  2578. gotoxy(54,10+i);cout<<"|";
  2579. }
  2580.  
  2581. gotoxy(26,10);
  2582. cout<<"ENTER THE ATOMIC NUMBER";
  2583. gotoxy(51,10);
  2584.  
  2585. cin>>n;
  2586.  
  2587. while(f.read((char*)&p,size))
  2588.  
  2589. {
  2590.  
  2591. if(p.Z()==n)
  2592.  
  2593. { p.SINGLEOUT();flag=0;}
  2594.  
  2595. }
  2596.  
  2597. if(flag!=0)
  2598. {
  2599. for(i=0;i<30;i++)
  2600. {
  2601. gotoxy(24+i,14);
  2602. cout<<"==";
  2603. gotoxy(24+i,16);
  2604. cout<<"==";
  2605. }
  2606. for(i=0;i<1;i++)
  2607. {
  2608. gotoxy(24,15+i);cout<<"|";
  2609. gotoxy(54,15+i);cout<<"|";
  2610. }
  2611.  
  2612. gotoxy(26,15);
  2613. cout<<" ELEMENT NOT FOUND!!";
  2614. gotoxy(51,15);
  2615.  
  2616. }
  2617. f.close();
  2618.  
  2619. getch();
  2620.  
  2621. }
  2622.  
  2623.  
  2624.  
  2625. void SEARCH()
  2626.  
  2627. {
  2628. clrscr();
  2629. SHOWDATE();
  2630.  
  2631. char str[40];
  2632.  
  2633. int n;
  2634.  
  2635. Q:
  2636.  
  2637. clrscr();
  2638. gotoxy(37,4);
  2639. cout<<"SEARCH MENU";
  2640. for(int i=0;i<10;i++)
  2641. { gotoxy(12,5+i);
  2642. cout<<"||";
  2643. gotoxy(18,5+i);
  2644. cout<<"||";
  2645. gotoxy(70,5+i);
  2646. cout<<"||";
  2647. }
  2648. for(i=0;i<59;i++)
  2649. { gotoxy(12+i,5);
  2650. cout<<"==";
  2651. gotoxy(12+i,15);
  2652. cout<<"==";
  2653. gotoxy(12+i,8);
  2654. cout<<"==";
  2655. gotoxy(12+i,12);
  2656. cout<<"==";
  2657. }
  2658.  
  2659.  
  2660.  
  2661. gotoxy(15,6);cout<<"1.";gotoxy(24,6);cout<<"TO SEARCH THE ELEMENT BY NAME";
  2662. gotoxy(15,10);cout<<"2.";gotoxy(24,10);cout<<"TO SEARCH THE ELEMENT BY ATOMIC NUMBER";
  2663. gotoxy(15,14);cout<<"3.";gotoxy(24,14);cout<<"TO SEARCH THE ELEMENT BY SYMBOL";
  2664.  
  2665. for(i=0;i<30;i++)
  2666. {
  2667. gotoxy(24+i,19);
  2668. cout<<"==";
  2669. gotoxy(24+i,21);
  2670. cout<<"==";
  2671. }
  2672. for(i=0;i<1;i++)
  2673. {
  2674. gotoxy(24,20+i);cout<<"|";
  2675. gotoxy(49,20+i);cout<<"|";
  2676. gotoxy(54,20+i);cout<<"|";
  2677. }
  2678. gotoxy(26,20);
  2679. cout<<"ENTER YOUR CHOICE";
  2680. gotoxy(51,20);
  2681.  
  2682. cin>>n;
  2683.  
  2684. switch(n)
  2685.  
  2686. { case 1:SEARCHBYNAME();break;
  2687.  
  2688. case 2:SEARCHBYZ();break;
  2689.  
  2690. case 3:SEARCHBYS();break;
  2691.  
  2692. default:{ for(i=0;i<30;i++)
  2693. {
  2694. gotoxy(24+i,19);
  2695. cout<<"==";
  2696. gotoxy(24+i,21);
  2697. cout<<"==";
  2698. }
  2699. for(i=0;i<1;i++)
  2700. {
  2701. gotoxy(24,20+i);cout<<"|";
  2702. gotoxy(54,20+i);cout<<"|";
  2703. }
  2704. gotoxy(25,20);
  2705. cout<<"PLEASE PROVIDE A VALID INPUNT";
  2706. gotoxy(51,20);
  2707. getch();
  2708. goto Q;
  2709. }
  2710.  
  2711. }
  2712.  
  2713. }
  2714.  
  2715. void INPUT()
  2716.  
  2717. { PERIODIC p1,p2;
  2718. clrscr();
  2719. SHOWDATE();
  2720. p2.IN();
  2721.  
  2722. fstream f1,f2;
  2723.  
  2724. f1.open("data.dat",ios::in|ios::binary);
  2725. f2.open("new.dat",ios::app|ios::binary);
  2726.  
  2727. if(f1.fail())
  2728.  
  2729. { cerr<<"\nUnable to open file";getch();
  2730.  
  2731. exit(1);
  2732.  
  2733. }
  2734. if(f2.fail())
  2735.  
  2736. { cerr<<"\nUnable to open file";getch();
  2737.  
  2738. exit(1);
  2739.  
  2740. }
  2741. while(f1.read((char*)&p1,size))
  2742. {
  2743. if((p1.Z()-1)==p2.Z())
  2744. {
  2745. f2.write((char*)&p2,size);
  2746. f2.write((char*)&p1,size);
  2747. }
  2748. else
  2749. {
  2750. f2.write((char*)&p1,size);
  2751. }
  2752.  
  2753.  
  2754. }
  2755.  
  2756.  
  2757. f1.close();
  2758. f2.close();
  2759. remove("data.dat");
  2760. rename("new.dat","data.dat");
  2761. cout<<"\n\tElement added";
  2762. getch();
  2763. }
  2764.  
  2765. void SHOW()
  2766.  
  2767. { fstream f; PERIODIC p;
  2768. clrscr();
  2769. SHOWDATE();
  2770.  
  2771. int n=1,k=0;
  2772.  
  2773. char ch[2];
  2774.  
  2775. clrscr();
  2776.  
  2777. SHOWDATE();
  2778. f.open("data.dat",ios::in|ios::binary);
  2779.  
  2780. if(f.fail())
  2781.  
  2782. { cerr<<"\nUnable to open file.";
  2783.  
  2784. getch();exit(1);
  2785.  
  2786. }
  2787.  
  2788. f.seekg(0,ios::end);
  2789.  
  2790. n=f.tellg();
  2791.  
  2792. if(n==0)
  2793.  
  2794. { cout<<"\nNo element exist."; getch();
  2795.  
  2796. return;
  2797.  
  2798. }
  2799.  
  2800. f.seekg(0,ios::beg);
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806. while(f.read((char*)&p,size))
  2807.  
  2808. { if(k==0)
  2809.  
  2810. clrscr();
  2811.  
  2812. p.OUT();cout<<"\n";
  2813.  
  2814. delay(800);
  2815.  
  2816. k++;
  2817.  
  2818. if(k%4==0)
  2819.  
  2820. {
  2821.  
  2822. cout<<"\nPress 'Q' to exit or else to continue......";
  2823.  
  2824. gets(ch);
  2825.  
  2826. if((strcmpi(ch,"Q")==0)||(strcmpi(ch,"q")==0))
  2827.  
  2828. { clrscr();
  2829.  
  2830. gotoxy(30,12);
  2831.  
  2832. cout<<"THANK YOU FOR USING....";
  2833.  
  2834. f.close();
  2835.  
  2836. getch();return;
  2837.  
  2838. }
  2839.  
  2840. clrscr();
  2841.  
  2842. }
  2843.  
  2844. }
  2845.  
  2846. getch();
  2847.  
  2848. f.close();
  2849.  
  2850. }
  2851.  
  2852. void CREDIT()
  2853.  
  2854. { clrscr();
  2855. SHOWDATE();
  2856. gotoxy(30,10);
  2857.  
  2858. cout<<"Name: Harshita";
  2859.  
  2860. gotoxy(30,11);
  2861.  
  2862. cout<<"Class: XII-C";
  2863.  
  2864. gotoxy(30,12);
  2865.  
  2866. cout<<"Roll number: 9183188";
  2867.  
  2868. delay(1000);
  2869.  
  2870. gotoxy(30,14);
  2871.  
  2872. cout<<"Name: Anton";
  2873.  
  2874. gotoxy(30,15);
  2875.  
  2876. cout<<"Class: XII-C";
  2877.  
  2878. gotoxy(30,16);
  2879.  
  2880. cout<<"Roll number: 9183187";
  2881.  
  2882. delay(1000);
  2883.  
  2884. gotoxy(30,18);
  2885.  
  2886. cout<<"Name: Durvish";
  2887.  
  2888. gotoxy(30,19);
  2889.  
  2890. cout<<"Class: XII-C";
  2891.  
  2892. gotoxy(30,20);
  2893.  
  2894. cout<<"Roll number: 9183177";
  2895.  
  2896. delay(1000);
  2897. getch();
  2898. }
  2899. void load()
  2900. {
  2901. clrscr();
  2902. int k,s=9;int m;int j;int n;
  2903. clrscr();
  2904. SHOWDATE();
  2905. gotoxy(35,7);cout<<"LOADING...";
  2906. gotoxy(27,10);cout<<"||";gotoxy(51,10);cout<<"||";
  2907. for(int q=0;q<2;q++)
  2908. { if(q==1)
  2909. s=11;
  2910. for(int w=27;w<52;w++)
  2911. {
  2912. gotoxy(w,s);
  2913. cout<<"-";
  2914. }
  2915.  
  2916.  
  2917. }
  2918.  
  2919. for(int a=0;a<3;a++)
  2920. {
  2921. k=10;m=n=30;
  2922. for(int i=0;i<=20;i++)
  2923. {
  2924. if(i>=10)
  2925. {
  2926. gotoxy(n,k);
  2927. delay(80);
  2928. cout<<" ";
  2929. n=n+2;
  2930. }
  2931. else
  2932. {
  2933. gotoxy(m,k);
  2934. delay(80);
  2935. cout <<"*";
  2936. m =m+2;
  2937. }
  2938. }
  2939. }
  2940. gotoxy(33,10);
  2941. cout<<"TAP TO CONTINUE";
  2942. getch();
  2943. }
  2944. void ADMIN()
  2945.  
  2946. { int n=0,ch;
  2947. clrscr();
  2948. fstream f;
  2949. SHOWDATE();
  2950. lock();
  2951. SHOWDATE();
  2952. textbackground(BLUE);
  2953.  
  2954. textcolor(YELLOW);
  2955.  
  2956. f.open("data.dat",ios::in|ios::app|ios::binary);
  2957.  
  2958. if(f.fail())
  2959.  
  2960. { cerr<<"\nUnable to open file";
  2961.  
  2962. getch();
  2963.  
  2964. exit(1);
  2965.  
  2966. }
  2967.  
  2968.  
  2969.  
  2970. f.seekg(0,ios::end);
  2971.  
  2972. n=f.tellg();
  2973.  
  2974. f.close();
  2975.  
  2976. PERIODIC P;
  2977. if(n==0)
  2978.  
  2979. {
  2980. P.INITIALISE(1,"Hydrogen","H",1.008,1,1,20.3,0.084,25,"1s1");
  2981.  
  2982. P.INITIALISE(2,"Helium","Be",4.003,18,1,3750.0,1.85,105.0,"1s2");
  2983.  
  2984. P.INITIALISE(3,"Lithium","Li",6.941,1,2,1615.0,0.53,145,"[He]2s1");
  2985.  
  2986. P.INITIALISE(4,"Berylium","Be",9.012,2,2,3750,1.85,105,"[He]2s2");
  2987.  
  2988. P.INITIALISE(5,"Boron","B",10.81,13,2,4200,2.46,85,"[He]2s2 2p1");
  2989.  
  2990. P.INITIALISE(6,"Carbon","C",12.011,14,2,5100,3.51,70,"[He]2s2 2p2");
  2991.  
  2992. P.INITIALISE(7,"Nitrogen","N",14.007,15,2,77.4,1.17,65,"[He]2s2 2p3");
  2993.  
  2994. P.INITIALISE(8,"Oxygen","O",15.999,16,2,90.2,1.33,60,"[He]2s2 2p4");
  2995.  
  2996. P.INITIALISE(9,"Fluorine","F",18.998,17,2,85.0,1.58,50,"[He]2s2 2p5");
  2997.  
  2998. P.INITIALISE(10,"Neon","Ne",20.180,18,2,27.1,0.84,38,"[He]2s2 2p6");
  2999.  
  3000. P.INITIALISE(11,"Sodium","Na",22.990,1,3,1156,0.97,180,"[Ne]3s1");
  3001.  
  3002. P.INITIALISE(12,"Magnesium","Mg",24.305,2,3,1380,1.74,150,"[Ne]3s2");
  3003.  
  3004. P.INITIALISE(13,"Aluminium","Al",26.920,13,3,1740,2.70,125,"[Ne]3s2 3p1");
  3005.  
  3006. P.INITIALISE(14,"Silicon","Si",28.085,14,3,2628,2.33,110,"[Ne]3s2 3p2");
  3007.  
  3008. P.INITIALISE(15,"Phosphorus","P",30.974,15,3,550,1.82,100,"[Ne]3s2 3p3");
  3009.  
  3010. P.INITIALISE(16,"Sulphur","S",62.065,16,3,718,2.06,100,"[Ne]3s2 3p4");
  3011.  
  3012. P.INITIALISE(17,"Chlorine","Cl",35.453,17,3,239,2.94,100,"[Ne]3s2 3p5");
  3013.  
  3014. P.INITIALISE(18,"Argon","Ar",39.948,18,3,87,1.66,71,"[Ne]3s2 3p6");
  3015.  
  3016. P.INITIALISE(19,"Potassium","K",39.098,1,4,1032,0.86,220,"[Ar]4s1");
  3017.  
  3018. P.INITIALISE(20,"Calcium","Ca",40.078,2,4,1757,1.54,280,"[Ar]4s2");
  3019.  
  3020. P.INITIALISE(21,"Scandium","Sc",44.956,3,4,3103,2.99,160,"[Ar]4s2 3d1");
  3021.  
  3022. P.INITIALISE(22,"Titianium","Ti",47.867,4,4,3560,4.51,140,"[Ar]4s2 3d2");
  3023.  
  3024. P.INITIALISE(23,"Vandium","V",50.942,5,4,3680,6.09,135,"[Ar]4s2 3d3");
  3025.  
  3026. P.INITIALISE(24,"Chromium","Cr",51.996,6,4,2945,7.14,140,"[Ar]4s1 3d5");
  3027.  
  3028. P.INITIALISE(25,"Manganese","Mn",54.938,7,4,2235,7.44,140,"[Ar]4s2 3d5");
  3029.  
  3030. P.INITIALISE(26,"Iron","Fe",55.854,8,4,3023,7.87,140,"[Ar]4s2 3d6");
  3031.  
  3032. P.INITIALISE(27,"Cobalt","Co",68.993,9,4,3200,8.89,135,"[Ar]4s2 3d7");
  3033.  
  3034. P.INITIALISE(28,"Nickel","Ni",58.693,10,4,3186,8.91,135,"[Ar]4s2 3d8");
  3035.  
  3036. P.INITIALISE(29,"Copper","Cu",63.456,11,4,2840,8.92,135,"[Ar]4s1 3d10");
  3037.  
  3038. P.INITIALISE(30,"Zinc","Zn",65.39,12,4,1180,7.14,135,"[Ar]4s2 3d10");
  3039.  
  3040. P.INITIALISE(31,"Gallium","Ga",69.723,13,4,2477,5.91,130.0,"[Ar]3d10 4s2 4p1");
  3041.  
  3042. P.INITIALISE(32,"Germanium","Ge",72.64,14,4,3093,5.32,125.0,"[Ar]3d10 4s2 4p2");
  3043.  
  3044. P.INITIALISE(33,"Arsenic","As",74.922,15,4,889,5.72,115.0,"[Ar]3d10 4s2 4p3");
  3045.  
  3046. P.INITIALISE(34,"Selenium","Se",78.96,16,4,958,4.82,115.0,"[Ar]3d10 4s2 4p4");
  3047.  
  3048. P.INITIALISE(35,"Bromine","Br",79.904,17,4,332,3.14,115.0,"[Ar]3d10 4s2 4p5");
  3049.  
  3050. P.INITIALISE(36,"Krypton","Kr",83.8,18,4,120,3.48,88.0,"[Ar]3d10 4s2 4p6");
  3051.  
  3052. P.INITIALISE(37,"Rubidium","Rb",85.468,1,5,961,1.53,235.0,"[Kr]5s1");
  3053.  
  3054. P.INITIALISE(38,"Strontium","Sr",87.62,2,5,1655,2.63,200.0,"[Kr]5s2");
  3055.  
  3056. P.INITIALISE(39,"Yttrium","Y",88.906,3,5,3609,4.47,18.0,"[Kr]4d1 5s2");
  3057.  
  3058. P.INITIALISE(40,"Zirconcium","Zr",91.224,4,5,4682,6.51,155.0,"[Kr]4d2 5s2");
  3059.  
  3060. P.INITIALISE(41,"Niobium","Nb",92.906,5 ,5,5017,8.58,145,"[Kr]4d4 5s1");
  3061.  
  3062. P.INITIALISE(42,"Molybdenum","Mo",95.45,6 ,5,4912,10.28,145,"[Kr]4d5 5s1");
  3063.  
  3064. P.INITIALISE(43,"Technetium","Tc",98,7 ,5 ,5150,11.49,135,"[Kr]4d5 5s2");
  3065.  
  3066. P.INITIALISE(44,"Ruthenium","Ru",101.07,8 ,5,4423,12.45,130,"[Kr]4d7 5s1");
  3067.  
  3068. P.INITIALISE(45,"Rhodium","Rh",102.91, 9,5,3968,12.41,135,"[Kr]4d8 5s1");
  3069.  
  3070. P.INITIALISE(46,"Palladium","Pd",106.42,10 ,5,3236,12.02,140,"[Kr]4d10");
  3071.  
  3072. P.INITIALISE(47,"Silver","Ag",107.87,11 ,5,2435,10.49,160,"[Kr]4d10 5s1");
  3073.  
  3074. P.INITIALISE(48,"Cadmium","Cd",112.41,12 ,5,1040,8.64,155,"[Kr]4d10 5s2");
  3075.  
  3076. P.INITIALISE(49,"Indium","In",114.82,13,5,2345,7.31,155,"[Kr]4d10 5s2 5p1");
  3077.  
  3078. P.INITIALISE(50,"Tin","Sn",118.71,14,5,2875,7.29,145,"[Kr]4d10 5s2 5p2");
  3079.  
  3080. P.INITIALISE(51,"Antimony","Sb",121.76,15,5,1860,6.69,145,"[Kr]4d10 5s2 5p3");
  3081.  
  3082. P.INITIALISE(52,"Tellurium","Te",127.6,16,5,1263,6.25,140,"[Kr]4d10 5s2 5p4");
  3083.  
  3084. P.INITIALISE(53,"Iodine","I",126.90,17,5,457,4.94,140,"[Kr]4d10 5s2 5p5");
  3085.  
  3086. P.INITIALISE(54,"Xenon","Xe",131.29,18,5,165,4.49,108,"[Kr]4d10 5s2 5p6");
  3087.  
  3088. P.INITIALISE(55,"Caesium","Cs",132.90,1,6,944,1.90,260,"[Xe]6s1");
  3089.  
  3090. P.INITIALISE(56,"Barium","Ba",137.33,2,6,1913,3.65,215,"[Xe]6s2");
  3091.  
  3092. P.INITIALISE(57,"Lanthanum","La",138.91,3 ,6,3730,6.16,195,"[Xe]5d1 6s2");
  3093.  
  3094. P.INITIALISE(58,"Cerium","Ce",140.12,3,6,3716,6.77,185,"[Xe]4f1 5d1 6s2");
  3095.  
  3096. P.INITIALISE(59,"Praseodymium","Pr",140.91,3 ,6,3793,6.48,185,"[Xe]4f3 6s2");
  3097.  
  3098. P.INITIALISE(60,"Neodymium","Nd",144.24,3 ,6,3373,7.00,185,"[Xe]4f4 6s2");
  3099.  
  3100. P.INITIALISE(61,"Promethium","Pm",145, 3, 6,3273,7.22,185,"[Xe]4f5 6s2");
  3101.  
  3102. P.INITIALISE(62,"Samarium","Sm",150.36,3 ,6,2076,7.54,185,"[Xe]4f6 6s2");
  3103.  
  3104. P.INITIALISE(63,"Europium","Eu",151.96, 3,6,1800,6.16,185,"[Xe]4f7 6s2");
  3105.  
  3106. P.INITIALISE(64,"Gadolinium","Gd",157.25,3 ,6,3523,7.89,180,"[Xe]4f7 5d1 6s2");
  3107.  
  3108. P.INITIALISE(65,"Terbium","Tb",158.92,3 ,6,3503,8.25,175,"[Xe]4f9 6s2");
  3109.  
  3110. P.INITIALISE(66,"Dysprosium","Dy",162.5,3 ,6,2840,8.56,175,"[Xe]f410 6s2");
  3111.  
  3112. P.INITIALISE(67,"Holmium","Ho",163.93, 3,6,2963,8.78,175,"[Xe]f411 6s2");
  3113.  
  3114. P.INITIALISE(68,"Erbium","Er",167.26,3 ,6,2783,9.05,175,"[Xe]f412 6s2");
  3115.  
  3116. P.INITIALISE(69,"Thulium","Tm",168.93,3 ,6,2220,9.32,175,"[Xe]f413 6s2");
  3117.  
  3118. P.INITIALISE(70,"Ytterbium","Yb",173.04,3 ,6,1467,6.97,175,"[Xe]f414 6s2");
  3119.  
  3120. P.INITIALISE(71,"Lutetium","Lu",174.97,3 ,6,3668,9.84,175,"[Xe]f414 6s2 5d1");
  3121.  
  3122. P.INITIALISE(72,"Hafnium","Hf",178.49,4 ,6,4876,13.31,155,"[Xe]f4f14 6s2 5d2");
  3123.  
  3124. P.INITIALISE(73,"Tantalum","Ta",180.95,5 ,6,5731,16.68,145,"[Xe]f4f14 6s2 5d3");
  3125.  
  3126. P.INITIALISE(74,"Tungsten","W",183.84,6 ,6,5828,19.26,135,"[Xe]f4f14 6s2 5d4");
  3127.  
  3128. P.INITIALISE(75,"Rhenium","Re",186.21, 7,6,5869,21.03,135,"[Xe]f4f14 6s2 5d5");
  3129.  
  3130. P.INITIALISE(76,"Osmium","Os",190.23, 8,6,5285,22.61,130,"[Xe]f4f14 6s2 5d6");
  3131.  
  3132. P.INITIALISE(77,"Iridium","Ir",192.22,9 ,6,4701,22.65,135,"[Xe]f4f14 6s2 5d7");
  3133.  
  3134. P.INITIALISE(78,"Platinum","Pt",195.08,10 ,6,4100,21.45,135,"[Xe]f4f14 6s1 5d9");
  3135.  
  3136. P.INITIALISE(79,"Gold","Au",196.97,11 ,6,3129,19.32,135,"[Xe]f4f14 6s1 5d10");
  3137.  
  3138. P.INITIALISE(80,"Mercury","Hg",200.59,12 ,6,630,13.55,150,"[Xe]f4f14 6s2 5d10 6p1");
  3139.  
  3140. P.INITIALISE(81,"Thallium","Tl",204.38,13,6,1746,11.85,190,"[Xe]f4f14 6s2 5d10 6p2");
  3141.  
  3142. P.INITIALISE(82,"Lead","Pb",207.2,14,6,2023,11.34,180,"[Xe]f4f14 6s2 5d10 6p3");
  3143.  
  3144. P.INITIALISE(83,"Bismuth","Bi",208.98,15,6 ,1837,9.80,160,"[Xe]f4f14 6s2 5d10 6p4");
  3145.  
  3146. P.INITIALISE(84,"Polonium","Po",209,16,6 ,1235,9.20,190,"[Xe]f4f14 6s2 5d10 6p5");
  3147.  
  3148. SHOWDATE();
  3149. load();
  3150. cout<<"\t\tElements created.";
  3151.  
  3152. getch();
  3153.  
  3154.  
  3155.  
  3156. }
  3157.  
  3158. else
  3159.  
  3160. { B:
  3161.  
  3162. clrscr();
  3163. SHOWDATE();
  3164. gotoxy(37,1);
  3165. cout<<"USER MENU";
  3166. for(int i=0;i<16;i++)
  3167. { gotoxy(12,2+i);
  3168. cout<<"||";
  3169. gotoxy(18,2+i);
  3170. cout<<"||";
  3171. gotoxy(70,2+i);
  3172. cout<<"||";
  3173. }
  3174. for(i=0;i<59;i++)
  3175. { gotoxy(12+i,2);
  3176. cout<<"==";
  3177. gotoxy(12+i,8);
  3178. cout<<"==";
  3179. gotoxy(12+i,4);
  3180. cout<<"==";
  3181. gotoxy(12+i,6);
  3182. cout<<"==";
  3183. gotoxy(12+i,10);
  3184. cout<<"==";
  3185. gotoxy(12+i,12);
  3186. cout<<"==";
  3187. gotoxy(12+i,14);
  3188. cout<<"==";
  3189. gotoxy(12+i,16);
  3190. cout<<"==";
  3191. gotoxy(12+i,18);
  3192. cout<<"==";
  3193. }
  3194.  
  3195.  
  3196.  
  3197. gotoxy(15,3);cout<<"1.";gotoxy(24,3);cout<<"TO DISPLAY THE PERIODIC TABLE";
  3198. gotoxy(15,5);cout<<"2.";gotoxy(24,5);cout<<"TO DELETE AN ELEMENT";
  3199. gotoxy(15,7);cout<<"3.";gotoxy(24,7);cout<<"TO ENTER A NEW ELEMENT";
  3200. gotoxy(15,9);cout<<"4.";gotoxy(24,9);cout<<"TO DISPLAY THE ELEMENTS";
  3201. gotoxy(15,11);cout<<"5.";gotoxy(24,11);cout<<"TO MODIFY THE PROPERTIES";
  3202. gotoxy(15,13);cout<<"6.";gotoxy(24,13);cout<<"TO SEARCH AN ELEMENT";
  3203. gotoxy(15,15);cout<<"7.";gotoxy(24,15);cout<<"TO GO BACK TO THE MAIN MENU";
  3204. gotoxy(15,17);cout<<"8.";gotoxy(24,17);cout<<"TO QUIT THE PROGRAM";
  3205. for(i=0;i<30;i++)
  3206. {
  3207. gotoxy(24+i,23);
  3208. cout<<"==";
  3209. gotoxy(24+i,25);
  3210. cout<<"==";
  3211. }
  3212. for(i=0;i<1;i++)
  3213. {
  3214. gotoxy(24,24+i);cout<<"|";
  3215. gotoxy(49,24+i);cout<<"|";
  3216. gotoxy(54,24+i);cout<<"|";
  3217. }
  3218. gotoxy(26,24);
  3219. cout<<"ENTER YOUR CHOICE";
  3220. gotoxy(51,24);
  3221.  
  3222. cin>>ch;
  3223.  
  3224. switch(ch)
  3225.  
  3226. z { case 1:DISPLAY();break;
  3227.  
  3228. case 2:DELETE();break;
  3229.  
  3230. case 3:INPUT();break;
  3231.  
  3232. case 4:SHOW();break;
  3233.  
  3234. case 5:MODIFY();break;
  3235.  
  3236. case 6:SEARCH();break;
  3237.  
  3238. case 7:break;
  3239.  
  3240. case 8:{getch();exit(0);}
  3241.  
  3242. default:{
  3243. for(i=0;i<30;i++)
  3244. {
  3245. gotoxy(24+i,23);
  3246. cout<<"==";
  3247. gotoxy(24+i,25);
  3248. cout<<"==";
  3249. }
  3250. for(i=0;i<1;i++)
  3251. {
  3252. gotoxy(24,24+i);cout<<"|";
  3253. gotoxy(49,24+i);cout<<"|";
  3254. gotoxy(54,24+i);cout<<"|";
  3255. }
  3256. gotoxy(26,24);
  3257. cout<<"INVALID INPUT";
  3258. getch();
  3259.  
  3260. goto B;
  3261.  
  3262. }
  3263.  
  3264. }
  3265.  
  3266.  
  3267.  
  3268. }
  3269.  
  3270. if(ch!=7)
  3271.  
  3272. goto B;
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280. }
  3281.  
  3282. void USER()
  3283.  
  3284. { int n;
  3285.  
  3286. textbackground(BLUE);
  3287.  
  3288. textcolor(YELLOW);
  3289.  
  3290. C:
  3291.  
  3292. clrscr();
  3293. SHOWDATE();
  3294. gotoxy(37,1);
  3295. cout<<"USER MENU";
  3296. for(int i=0;i<22;i++)
  3297. { gotoxy(12,2+i);
  3298. cout<<"||";
  3299. gotoxy(18,2+i);
  3300. cout<<"||";
  3301. gotoxy(70,2+i);
  3302. cout<<"||";
  3303. }
  3304. for(i=0;i<59;i++)
  3305. { gotoxy(12+i,2);
  3306. cout<<"==";
  3307. gotoxy(12+i,11);
  3308. cout<<"==";
  3309. gotoxy(12+i,5);
  3310. cout<<"==";
  3311. gotoxy(12+i,8);
  3312. cout<<"==";
  3313. gotoxy(12+i,14);
  3314. cout<<"==";
  3315. gotoxy(12+i,17);
  3316. cout<<"==";
  3317. gotoxy(12+i,20);
  3318. cout<<"==";
  3319. gotoxy(12+i,23);
  3320. cout<<"==";
  3321. }
  3322.  
  3323.  
  3324.  
  3325. gotoxy(15,3);cout<<"1.";gotoxy(24,3);cout<<"TO DISPLAY THE PERIODIC TABLE";
  3326. gotoxy(15,6);cout<<"2.";gotoxy(24,6);cout<<"TO SEARCH AN ELEMENT";
  3327. gotoxy(15,9);cout<<"3.";gotoxy(24,9);cout<<"TO COMPARE ANY TWO ELEMENTS";
  3328. gotoxy(15,12);cout<<"4.";gotoxy(24,12);cout<<"TO DISPLAY AN ELEMENT";
  3329. gotoxy(15,15);cout<<"5.";gotoxy(24,15);cout<<"MEET THE PROGRAMMERS";
  3330. gotoxy(15,18);cout<<"6.";gotoxy(24,18);cout<<"TO GO BACK TO MAIN MENU";
  3331. gotoxy(15,21);cout<<"7.";gotoxy(24,21);cout<<"TO QUIT THE PROGRAM";
  3332. for(i=0;i<30;i++)
  3333. {
  3334. gotoxy(24+i,23);
  3335. cout<<"==";
  3336. gotoxy(24+i,25);
  3337. cout<<"==";
  3338. }
  3339. for(i=0;i<1;i++)
  3340. {
  3341. gotoxy(24,24+i);cout<<"|";
  3342. gotoxy(49,24+i);cout<<"|";
  3343. gotoxy(54,24+i);cout<<"|";
  3344. }
  3345. gotoxy(26,24);
  3346. cout<<"ENTER YOUR CHOICE";
  3347. gotoxy(51,24);
  3348.  
  3349. cin>>n;
  3350.  
  3351. switch(n)
  3352.  
  3353. { case 1:{
  3354.  
  3355. DISPLAY();
  3356.  
  3357. goto C;
  3358.  
  3359. }
  3360.  
  3361. case 2:SEARCH();break;
  3362.  
  3363. case 3:COMPARE();break;
  3364.  
  3365. case 4:SHOW();break;
  3366.  
  3367. case 5:CREDIT();break;
  3368.  
  3369. case 6:break;
  3370.  
  3371. case 7:exit(0);
  3372.  
  3373. default:{
  3374.  
  3375. cout<<"\nWRONG INPUT!";
  3376.  
  3377. getch();
  3378.  
  3379. goto C;
  3380.  
  3381. }
  3382.  
  3383. }
  3384.  
  3385. if(n!=6)
  3386.  
  3387. goto C;
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393. }
  3394. void SHOWDATE()
  3395. {
  3396. char z[12][20]={"January","February","March","April","May","June","July","August","September","October","November","December"};
  3397.  
  3398. date d;
  3399. getdate(&d);
  3400. gotoxy(65,1);
  3401. cout<<(int)d.da_day<<" ";
  3402. int l=d.da_mon;
  3403. l=l-1;
  3404. cout<<z[l]<<" ";
  3405. cout<<d.da_year;
  3406. }
  3407.  
  3408.  
  3409.  
  3410.  
  3411. void main()
  3412.  
  3413. {
  3414.  
  3415. int choice;
  3416. clrscr();
  3417. ENTER();
  3418. SHOWDATE();
  3419. char ch;
  3420.  
  3421. textbackground(BLUE);
  3422.  
  3423. textcolor(YELLOW);
  3424.  
  3425. do
  3426.  
  3427. { textbackground(BLUE);
  3428.  
  3429. textcolor(YELLOW);
  3430.  
  3431. A:
  3432.  
  3433. clrscr();
  3434.  
  3435.  
  3436. clrscr();
  3437. SHOWDATE();
  3438. gotoxy(37,4);cout<<(char)9734<<"MAIN MENU"<<(char)9734;
  3439. for(int i=0;i<10;i++)
  3440. { gotoxy(12,5+i);
  3441. cout<<"||";
  3442. gotoxy(18,5+i);
  3443. cout<<"||";
  3444. gotoxy(70,5+i);
  3445. cout<<"||";
  3446. }
  3447. for(i=0;i<59;i++)
  3448. { gotoxy(12+i,5);
  3449. cout<<"==";
  3450. gotoxy(12+i,15);
  3451. cout<<"==";
  3452. gotoxy(12+i,8);
  3453. cout<<"==";
  3454. gotoxy(12+i,12);
  3455. cout<<"==";
  3456. }
  3457.  
  3458.  
  3459.  
  3460. gotoxy(15,6);cout<<"1.";gotoxy(40,6);cout<<"ADMIN";
  3461. gotoxy(15,10);cout<<"2.";gotoxy(40,10);cout<<"USER";
  3462. gotoxy(15,14);cout<<"3.";gotoxy(40,14);cout<<"EXIT";
  3463. for(i=0;i<30;i++)
  3464. {
  3465. gotoxy(24+i,23);
  3466. cout<<"==";
  3467. gotoxy(24+i,25);
  3468. cout<<"==";
  3469. }
  3470. for(i=0;i<1;i++)
  3471. {
  3472. gotoxy(24,24+i);cout<<"|";
  3473. gotoxy(49,24+i);cout<<"|";
  3474. gotoxy(54,24+i);cout<<"|";
  3475. }
  3476. gotoxy(26,24);
  3477. cout<<"ENTER YOUR CHOICE";
  3478. gotoxy(51,24);
  3479.  
  3480. cin>>choice;
  3481.  
  3482. gotoxy(29,11);
  3483.  
  3484. switch(choice)
  3485.  
  3486. { case 1:{ADMIN();goto A; }
  3487.  
  3488. case 2:{USER();goto A;}
  3489.  
  3490. case 3:{getch();exit(0);}
  3491.  
  3492. default:{
  3493.  
  3494. gotoxy(10,12);
  3495.  
  3496. cout<<"\nWRONG INPUT!";
  3497.  
  3498. goto A;
  3499.  
  3500. }
  3501.  
  3502.  
  3503.  
  3504. }
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510. }while(ch=='y'||ch=='Y');
  3511.  
  3512. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement