Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream.h>
- #include<stdio.h>
- #include<conio.h>
- #include<string.h>
- #include<process.h>
- #include<dos.h>
- void load();
- void ENTER()
- { gotoxy(20,10);
- cout<<"ENTER ANY KEY TO ENTER THE WORLD OF SCIENCE...";
- getch();
- clrscr();
- char str1[7][100]={"PPPPP EEEEE RRRRR IIIIII OOOO DDDDD IIIIII CCCC"
- ,"P P E R R II O O D D II C "
- ,"P P E R R II O O D D II C "
- ,"PPPPP EEEEE RRRRR II O O D D II C "
- ,"P E R R II O O D D II C "
- ,"P E R R II O O D D II C "
- ,"P EEEEE R R IIIIII OOOO DDDDD IIIIII CCCC"};
- char str2[7][100]={"TTTTTTT AAA BBBBB L EEEEEE"
- ," TT A A B B L E "
- ," TT A A B B L E "
- ," TT A A BBBBB L EEEE "
- ," TT AAAAAAA B B L E "
- ," TT A A B B L E "
- ," TT A A BBBBB LLLLL EEEEEE"};
- int k;
- for(int i=0;i<7;i++)
- {
- k=strlen(str1[i]);
- k--;
- gotoxy(15,i+2);
- for(int l=0;l<k;l++)
- {
- cout<<str1[i][l];
- delay(10);
- }
- cout<<endl;
- }
- cout<<endl<<endl;
- for( i=0;i<7;i++)
- {
- k=strlen(str2[i]);
- k--;
- gotoxy(25,i+15);
- for(int l=0;l<k;l++)
- {
- cout<<str2[i][l];
- delay(10);
- }
- cout<<endl;
- }
- getch();
- }
- void DISPLAY()
- { clrscr();
- gotoxy(6,4);
- cout<<" \a P E R I O D I C T A B L E";
- gotoxy(6,6);
- cout<<"H He";
- delay(200);
- gotoxy(6,8);
- delay(200);
- cout<<"Li Be B C N O Fe Ne";
- delay(200);
- gotoxy(6,10);
- delay(200);
- cout<<"Na Mg Al Si P S Cl Ar";
- delay(200);
- gotoxy(6,12);
- delay(200);
- cout<<"K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr";
- delay(200);
- gotoxy(6,14);
- delay(200);
- cout<<"Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Ta I Xe";
- delay(200);
- gotoxy(6,16);
- delay(200);
- cout<<"Cs Ba * Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rd";
- delay(200);
- gotoxy(6,18);
- delay(200);
- cout<<"Fr Ra ** Rf Db Sg Bh Hs Mt Ds Rg Cn";
- delay(200);
- gotoxy(6,20);
- delay(200);
- cout<<" * La Ce Pr Nd Pm Sm En Gd Tb Dy Ho Er Tm Yb Ln";
- delay(200);
- gotoxy(6,22);
- delay(200);
- cout<<" ** Ac Th Pa U Np Pn Am Cm Bk Cf Es Fm Md No Lr";
- delay(200);
- cout<<"\n\n\t\t\t Press Any Key To Continue......";
- getch();
- }
- void SHOWDATE();
- void lock()
- { char user[50];int n,k=3;
- char a[10];
- E:
- clrscr();
- SHOWDATE();
- gotoxy(33,5);cout<<" USER:";gets(user);
- gotoxy(33,7);cout<<"PASSWORD:";
- for(int i=0;i<4;i++)
- {
- a[i]=getch();
- cout<<"*";
- }
- if(((strcmp("ZED",user))==0)&&(strcmp("4022",a)==0))
- {
- gotoxy(30,11);
- getch();
- cout<<" Access Granted";getch();
- return ;
- }
- else
- { gotoxy(34,12);
- cout<<"Access Denied";
- gotoxy(18,14);
- cout<<"Press 0 To Retry Or Any Other Key To Exit:";
- cin>>n;
- gotoxy(34,16);
- if(n==0)
- {cout<<""<<k-1<<" chances left";k--;getch();}
- if(k==0)
- exit(0);
- if(n==0)
- {
- goto E;
- }
- else
- { gotoxy(36,18);
- cout<<"Thank You";getch();
- exit(0);
- }
- }
- }
- class PERIODIC
- { float mass,bp,r,rho;
- int z,grp,prd;
- char sym[3],ec[50],name[30];
- public:
- float BP();
- char* NAME();
- void SINGLEOUT();
- float MASS();
- float R();
- void SYM(char []);
- int Z();
- void SETZ(int);
- void SETMASS(float);
- void SETGROUP(int);
- void SETPERIOD(int);
- void SETSYM(char[]);
- void SETEC(char[]);
- void SETBP(float);
- void SETR(float);
- void SETRHO(float);
- void INITIALISE(int ,char [],char [],float ,int ,int ,float ,float ,float ,char []);
- void IN();
- void OUT();
- };
- float PERIODIC::BP()
- {
- return bp;
- }
- char* PERIODIC::NAME()
- {
- return(name);
- }
- void PERIODIC::SYM(char a[])
- {
- strcpy(a,sym);
- }
- float PERIODIC::MASS()
- {
- return mass;
- }
- float PERIODIC::R()
- {
- return r;
- }
- int PERIODIC::Z()
- {
- return z;
- }
- void PERIODIC::SETZ(int a)
- {
- z=a;
- return;
- }
- void PERIODIC::SETMASS(float a)
- {
- mass=a;
- return;
- }
- void PERIODIC::SETGROUP(int a)
- {
- grp=a;
- return;
- }
- void PERIODIC::SETPERIOD(int a)
- {
- prd=a;
- return;
- }
- void PERIODIC::SETSYM(char a[])
- {
- strcpy(sym,a);
- return;
- }
- void PERIODIC::SETEC(char a[])
- {
- strcpy(ec,a);
- return;
- }
- void PERIODIC::SETBP(float a)
- {
- bp=a;
- return;
- }
- void PERIODIC::SETR(float a)
- {
- r=a;
- return;
- }
- void PERIODIC::SETRHO(float a)
- {
- rho=a;
- return;
- }
- long int size=sizeof(PERIODIC);
- void PERIODIC::IN()
- { SHOWDATE();
- cout<<"\nEnter the name of the element:";gets(name);
- cout<<"\nEnter the symbol of the element:";gets(sym);
- cout<<"\nEnter the atomic number(Z in pm):";cin>>z;
- cout<<"\nEnter the mass number (amu)(A):";cin>>mass;
- cout<<"\nEnter the group number:";cin>>grp;
- cout<<"\nEnter the period number:";cin>>prd;
- cout<<"\nEnter the boiling point:";cin>>bp;
- cout<<"\nEnter the density of the element(g/cm^3 at 293K):";cin>>rho;
- cout<<"\nEnter the atomic radii:";cin>>r;
- cout<<"\nEnter the Electronic Configuration:";gets(ec);
- cout<<"\nElement created";
- }
- void PERIODIC::OUT()
- { static int k=0;
- int i,j;
- SHOWDATE();
- if(k==0)
- { textcolor(RED);
- for(int l=0;l<24;l++)
- {
- gotoxy(42,l);
- cout<<"===";
- }
- for(int n=0;n<79;n++)
- {
- gotoxy(n,12);
- cout<<"||";
- }
- }
- textcolor(YELLOW);
- if(k==0)
- { i=1;j=1; }
- else if(k==1)
- { i=45;j=1;
- }
- else if(k==2)
- { i=1;j=13;}
- else if(k==3)
- { i=45;j=13;}
- gotoxy(i,j);
- cout<<"Name:"<<name;
- gotoxy(i,j+1);
- cout<<"Symbol:"<<sym;
- gotoxy(i,j+2);
- cout<<"Atomic Number:"<<z;
- gotoxy(i,j+3);
- cout<<"Mass Number:"<<mass<<" amu";
- gotoxy(i,j+4);
- cout<<"Group Number:"<<grp;
- gotoxy(i,j+5);
- cout<<"Period Number:"<<prd;
- gotoxy(i,j+6);
- cout<<"Boiling Point:"<<bp;
- gotoxy(i,j+7);
- cout<<"Denstiy of the element:"<<rho<<" g/cm^3";
- gotoxy(i,j+8);
- cout<<"Atomic Radius:"<<r<<" pm";
- gotoxy(i,j+9);
- cout<<"Electronic Configuration:"<<ec;
- if(k==3)
- { k=0;
- return;
- }
- k++;
- }
- void PERIODIC::SINGLEOUT()
- { clrscr();
- load();
- clrscr();
- SHOWDATE();
- int m,l=63,n=3;
- for(int k=0;k<11;k++)
- { m=18;
- for(;m<l;m++)
- { gotoxy(m,n);
- cout<<"==";
- }
- n=n+2;
- }
- l=18;n=3;
- for(k=0;k<3;k++)
- { m=3;
- for(;m<24;m++)
- { gotoxy(l,m);
- cout<<"||";
- }
- l=l+22;
- }
- gotoxy(25,4);
- cout<<"NAME";
- gotoxy(44,4);
- cout<<name;
- delay(500);
- gotoxy(25,6);
- cout<<"SYMBOL";
- gotoxy(44,6);
- cout<<sym;delay(500);
- gotoxy(25,8);
- cout<<"ATOMIC NUMBER";gotoxy(44,8);cout<<z;delay(500);
- gotoxy(24,10);
- cout<<"MASS NUMBER(amu)";gotoxy(44,10);cout<<mass;delay(500);
- gotoxy(25,12);
- cout<<"GROUP NUMBER";gotoxy(44,12);cout<<grp;delay(500);
- gotoxy(25,14);
- cout<<"PERIOD NUMBER";gotoxy(44,14);cout<<prd;delay(500);
- gotoxy(25,16);
- cout<<"BOILING POINT";gotoxy(44,16);cout<<bp;delay(500);
- gotoxy(25,18);
- cout<<"DENSITY(g/cm^3)";gotoxy(44,18);cout<<rho;delay(500);
- gotoxy(25,20);
- cout<<"ATOMIC RADIUS";gotoxy(44,20);cout<<r;delay(500);
- gotoxy(26,22);
- cout<<"EC";gotoxy(44,22);cout<<ec;delay(500);
- }
- void PERIODIC::INITIALISE(int a,char b[],char c[],float m,int d,int e,float x,float g,float h,char i[])
- {
- fstream f;
- f.open("data.dat",ios::app|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();
- exit(1);
- }
- z=a;
- strcpy(name,b);
- strcpy(sym,c) ;
- mass=m;
- grp=d;
- prd=e;
- bp=x;
- rho=g;
- r=h;
- strcpy(ec,i);
- f.write((char*)this,size);
- f.close();
- }
- void DELETE()
- { int num,k=1;
- fstream f1,f2;
- PERIODIC p;
- f1.open("data.dat",ios::in|ios::binary);
- if(f1.fail())
- { cerr<<"\nUnable to open the file.";
- getch();exit(1);
- }
- cout<<"\nEnter atomic number of the element you want to delete:";
- cin>>num;
- f2.open("naya.dat",ios::out|ios::binary);
- if(f2.fail())
- { cerr<<"\nUnable to open the file.";
- getch();exit(1);
- }
- while(f1.read((char*)&p,size))
- { if(p.Z()!=num)
- {
- f2.write((char*)&p,size);
- }
- if(p.Z()==num)
- k=-1;
- }
- f1.close();
- f2.close();
- if(k!=-1)
- cout<<"\nElement not found.";
- else
- cout<<" Element deleted.";
- getch();
- remove("data.dat");
- rename("naya.dat","data.dat");
- }
- void MODIFY()
- { clrscr();
- fstream f;
- SHOWDATE();
- int a,num,k=0;
- float mass,bp,r,rho;
- int z,grp,prd;
- char ch='n',name[50],ec[100],sym[3];
- PERIODIC p;
- f.open("data.dat",ios::in|ios::out|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();exit(1);
- }
- cout<<"\n\tENTER THE ATOMIC NO. OF THE ELEMENT YOU WANT TO MODIFY:";
- cin>>a;
- while(f.read((char*)&p,size))
- {
- if(p.Z()==a)
- { k=1;
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(int i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"Do you want to modify atomic number(Y/N) ";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"Enter atomic number";
- gotoxy(72,10);
- cin>>num;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETZ(num);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"Element modified";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"continue()";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='N'||ch=='n')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for( i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY MASS NUMBER(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for( i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER MASS NUMBER";
- gotoxy(72,10);
- cin>>num;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETMASS(num);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='N'||ch=='n')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY GROUP NUMBER(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for( i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER GRUOP NUMBER";
- gotoxy(72,10);
- cin>>num;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETGROUP(num);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='N'||ch=='n')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY PERIOD NUMBER(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER PERIOD NUMBER";
- gotoxy(72,10);
- cin>>num;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETPERIOD(num);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='N'||ch=='n')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY SYMBOL(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER SYMBOL";
- gotoxy(72,10);
- gets(sym);
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETSYM(sym);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='N'||ch=='n')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for( i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY EC(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER EC";
- gotoxy(72,10);
- gets(ec);
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETEC(ec);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='n'||ch=='N')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY BOILING POINT(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER BOILING POINT";
- gotoxy(72,10);
- cin>>bp;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETBP(bp);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='n'||ch=='N')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY ATOMIC RADIUS(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER ATOMIC RADIUS";
- gotoxy(72,10);
- cin>>r;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETR(r);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='n'||ch=='N')
- {
- return;
- }
- }
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"MODIFICATION WINDOW";
- for(i=0;i<4;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(21,6);cout<<"DO YOU WANT TO MODIFY DENSITY(Y/N)";
- gotoxy(72,6);
- cin>>ch;
- if(ch=='y'||ch=='Y')
- {
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- for(int i=0;i<8;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- gotoxy(14,10);
- cout<<"2.";
- gotoxy(21,10);
- cout<<"ENTER DENSITY";
- gotoxy(72,10);
- cin>>num;
- for(i=0;i<63;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- }
- for(i=0;i<11;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(69,5+i);
- cout<<"||";
- gotoxy(74,5+i);
- cout<<"||";
- }
- p.SETRHO(rho);
- f.seekp(-size,ios::cur);
- f.write((char*)&p,size);
- gotoxy(35,20);
- cout<<"ELEMENT MODIFIED";
- getch();
- gotoxy(14,14);
- cout<<"3.";
- gotoxy(21,14);
- cout<<"CONTINUE(Y/N)?";
- gotoxy(72,14);
- cin>>ch;
- if(ch=='n'||ch=='N')
- {
- return;
- }
- }
- }
- }
- if(k==0)
- { gotoxy(26,20);
- cout<<"Element not found.";
- getch();return;
- }
- f.close();
- }
- void TABLE1()
- { clrscr();
- SHOWDATE();
- for(int i=0;i<50;i++)
- {
- gotoxy(20+i,9);
- cout<<"==";
- gotoxy(20+i,11);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(20,10+i);cout<<"|";
- gotoxy(60,10+i);cout<<"|";
- gotoxy(70,10+i);cout<<"|";
- }
- gotoxy(22,10);
- cout<<"ENTER THE ATOMIC NUMBER OF ELEMENT";
- }
- void CBP()
- { int a1,a2,i=0,j=0; float x,y;
- clrscr();
- SHOWDATE();
- PERIODIC p1,p2;
- char n1[50],n2[50];
- fstream f;
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();exit(1);
- }
- L:
- gotoxy(37,4);
- for(int z=0;z<5;z++)
- {
- gotoxy(37,4);
- delay(500);
- cout<<"FOR ELEMENT 1";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 1";
- gotoxy(65,10);
- cin>>a1;
- clrscr();
- SHOWDATE();
- for(z=0;z<5;z++)
- { delay(500);
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- gotoxy(65,10);
- cin>>a2;
- while(f.read((char*)&p1,size))
- {
- if(p1.Z()==a1)
- { x=p1.BP();
- strcpy(n1,p1.NAME());
- i=1;
- }
- if(p1.Z()==a2)
- { y=p1.BP();
- strcpy(n2,p1.NAME());
- j=1;
- }
- }
- if(i==0||j==0)
- { for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<"ELEMENTS DO NOT EXIST";
- gotoxy(51,15);
- getch();
- return;
- }
- clrscr();
- SHOWDATE();
- gotoxy(36,4);cout<<"COMPARISION";
- for( i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(40,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(5,6);
- cout<<"NAME";
- gotoxy(2,10);
- cout<<"ATOMIC NO.";
- gotoxy(1,13);
- cout<<" BOILING";
- gotoxy(1,14);
- cout<<" POINT";
- gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
- gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
- gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
- for(i=0;i<50;i++)
- {
- gotoxy(15+i,19);
- cout<<"==";
- gotoxy(15+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(15,20+i);cout<<"|";
- gotoxy(47,20+i);cout<<"|";
- gotoxy(65,20+i);cout<<"|";
- gotoxy(35,20+i);cout<<"|";
- }
- gotoxy(25,20);
- cout<<x;
- gotoxy(51,20);
- cout<<y;
- gotoxy(41,20);
- if(x>y)
- {
- cout<<">";
- }
- else if(y>x)
- {
- cout<<"<";
- }
- else
- {
- cout<<"=";
- }
- f.close();
- getch();
- }
- void CAM()
- { int a1,a2,i=0,j=0;float x,y;
- char n1[50],n2[50];
- clrscr();
- SHOWDATE();
- PERIODIC p1,p2;
- fstream f;
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();exit(1);
- }
- L:
- gotoxy(37,4);
- for(int z=0;z<5;z++)
- {
- gotoxy(37,4);
- delay(500);
- cout<<"FOR ELEMENT 1";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 1";
- gotoxy(65,10);
- cin>>a1;
- clrscr();
- SHOWDATE();
- for(z=0;z<5;z++)
- { delay(500);
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- gotoxy(65,10);
- cin>>a2;
- while(f.read((char*)&p1,size))
- {
- if(p1.Z()==a1)
- { x=p1.MASS();
- strcpy(n1,p1.NAME());
- i=1;
- }
- if(p1.Z()==a2)
- { y=p1.MASS();
- strcpy(n2,p1.NAME());
- j=1;
- }
- }
- if(i==0||j==0)
- { for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<"ELEMENTS DO NOT EXIST";
- gotoxy(51,15);
- getch();
- return;
- }
- clrscr();
- SHOWDATE();
- gotoxy(36,4);cout<<"COMPARISION";
- for( i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(40,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(5,6);
- cout<<"NAME";
- gotoxy(2,10);
- cout<<"ATOMIC NO.";
- gotoxy(1,13);
- cout<<" ATOMIC";
- gotoxy(1,14);
- cout<<"MASS";
- gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
- gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
- gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
- for(i=0;i<50;i++)
- {
- gotoxy(15+i,19);
- cout<<"==";
- gotoxy(15+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(15,20+i);cout<<"|";
- gotoxy(47,20+i);cout<<"|";
- gotoxy(65,20+i);cout<<"|";
- gotoxy(35,20+i);cout<<"|";
- }
- gotoxy(25,20);
- cout<<x;
- gotoxy(51,20);
- cout<<y;
- gotoxy(41,20);
- if(x>y)
- {
- cout<<">";
- }
- else if(y>x)
- {
- cout<<"<";
- }
- else
- {
- cout<<"=";
- }
- f.close();
- getch();
- }
- void CAR()
- { clrscr();
- SHOWDATE();
- int a1,a2,i=0,j=0; float x,y;
- char n1[50],n2[50];
- PERIODIC p1,p2;
- fstream f;
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();exit(1);
- }
- L:
- gotoxy(37,4);
- for(int z=0;z<5;z++)
- {
- gotoxy(37,4);
- delay(500);
- cout<<"FOR ELEMENT 1";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 1";
- gotoxy(65,10);
- cin>>a1;
- clrscr();
- SHOWDATE();
- for(z=0;z<5;z++)
- { delay(500);
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- delay(500);
- gotoxy(37,4);
- cout<<" ";
- }
- TABLE1();
- gotoxy(37,4);
- cout<<"FOR ELEMENT 2";
- gotoxy(65,10);
- cin>>a2;
- while(f.read((char*)&p1,size))
- {
- if(p1.Z()==a1)
- { x=p1.R();
- strcpy(n1,p1.NAME());
- i=1;
- }
- if(p1.Z()==a2)
- { y=p1.R();
- strcpy(n2,p1.NAME());
- j=1;
- }
- }
- if(i==0||j==0)
- { for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<"ELEMENTS DO NOT EXIST";
- gotoxy(51,15);
- getch();
- return;
- }
- clrscr();
- SHOWDATE();
- gotoxy(36,4);cout<<"COMPARISION";
- for( i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(40,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(5,6);
- cout<<"NAME";
- gotoxy(2,10);
- cout<<"ATOMIC NO.";
- gotoxy(1,13);
- cout<<" ATOMIC";
- gotoxy(1,14);
- cout<<" RADII";
- gotoxy(20,6);cout<<n1; gotoxy(50,6);cout<<n2;
- gotoxy(20,10);cout<<a1; gotoxy(50,10);cout<<a2;
- gotoxy(20,14);cout<<x;gotoxy(50,14);cout<<y;
- for(i=0;i<50;i++)
- {
- gotoxy(15+i,19);
- cout<<"==";
- gotoxy(15+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(15,20+i);cout<<"|";
- gotoxy(47,20+i);cout<<"|";
- gotoxy(65,20+i);cout<<"|";
- gotoxy(35,20+i);cout<<"|";
- }
- gotoxy(25,20);
- cout<<x;
- gotoxy(51,20);
- cout<<y;
- gotoxy(41,20);
- if(x>y)
- {
- cout<<">";
- }
- else if(y>x)
- {
- cout<<"<";
- }
- else
- {
- cout<<"=";
- }
- f.close();
- getch();
- }
- void COMPARE()
- { int n;
- L:
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<"COMPARE MENU";
- for(int i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(24,6);cout<<"TO COMAPRE ON THE BASIS OF BOILING POINT";
- gotoxy(15,10);cout<<"2.";gotoxy(24,10);cout<<"TO COMPARE ON THE BASIS OF ATOMIC MASS";
- gotoxy(15,14);cout<<"3.";gotoxy(24,14);cout<<"TO COMPARE ON THE BASIS OF ATOMIC RADII";
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,19);
- cout<<"==";
- gotoxy(24+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,20+i);cout<<"|";
- gotoxy(49,20+i);cout<<"|";
- gotoxy(54,20+i);cout<<"|";
- }
- gotoxy(26,20);
- cout<<"ENTER YOUR CHOICE";
- gotoxy(51,20);
- cin>>n;
- switch(n)
- { case 1:CBP();break;
- case 2:CAM();break;
- case 3:CAR();break;
- default:{ for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<"PLEASE PROVIDE A VALID INPUT";
- gotoxy(51,15);
- getch();
- goto L;
- }
- }
- }
- void SEARCHBYNAME()
- { fstream f;
- int flag=1;
- clrscr();
- PERIODIC p;
- SHOWDATE();
- char str[40],ch[40];
- f.open("data.dat",ios::in|ios::binary);
- f.seekg(0,ios::beg);
- if(f.fail())
- { cerr<<"\nUnable to open the file.";
- getch();exit(1);
- }
- for(int i=0;i<40;i++)
- {
- gotoxy(24+i,9);
- cout<<"==";
- gotoxy(24+i,11);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,10+i);cout<<"|";
- gotoxy(49,10+i);cout<<"|";
- }
- gotoxy(26,10);
- cout<<"ENTER THE NAME";
- gotoxy(51,10);
- gets(ch);
- while(f.read((char*)&p,size))
- {
- strcpy(str,p.NAME());
- if(strcmpi(str,ch)==0)
- { p.SINGLEOUT();flag=0;
- }
- }
- if(flag!=0)
- {
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<" ELEMENT NOT FOUND!!";
- gotoxy(51,15);
- }
- f.close();
- getch();
- }
- void SEARCHBYS()
- { fstream f;
- clrscr();
- int flag=1;
- SHOWDATE();
- PERIODIC p;
- char str[4],ch[4];
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file.";
- getch();exit(1);
- }
- for(int i=0;i<30;i++)
- {
- gotoxy(24+i,9);
- cout<<"==";
- gotoxy(24+i,11);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,10+i);cout<<"|";
- gotoxy(49,10+i);cout<<"|";
- gotoxy(54,10+i);cout<<"|";
- }
- gotoxy(26,10);
- cout<<"ENTER THE SYMBOL";
- gotoxy(51,10);
- gets(ch);
- f.seekg(0,ios::beg);
- while(f.read((char*)&p,size))
- {
- p.SYM(str);
- if(strcmpi(str,ch)==0)
- { p.SINGLEOUT();flag=0;
- }
- }
- if(flag!=0)
- { for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<" ELEMENT NOT FOUND!!";
- gotoxy(51,15);
- }
- f.close();
- getch();
- }
- void SEARCHBYZ()
- { fstream f; PERIODIC p;
- clrscr();
- int n,s,flag=1;
- SHOWDATE();
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open the file";
- getch();exit(1);
- }
- f.seekg(0,ios::beg);
- for(int i=0;i<30;i++)
- {
- gotoxy(24+i,9);
- cout<<"==";
- gotoxy(24+i,11);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,10+i);cout<<"|";
- gotoxy(49,10+i);cout<<"|";
- gotoxy(54,10+i);cout<<"|";
- }
- gotoxy(26,10);
- cout<<"ENTER THE ATOMIC NUMBER";
- gotoxy(51,10);
- cin>>n;
- while(f.read((char*)&p,size))
- {
- if(p.Z()==n)
- { p.SINGLEOUT();flag=0;}
- }
- if(flag!=0)
- {
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,14);
- cout<<"==";
- gotoxy(24+i,16);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,15+i);cout<<"|";
- gotoxy(54,15+i);cout<<"|";
- }
- gotoxy(26,15);
- cout<<" ELEMENT NOT FOUND!!";
- gotoxy(51,15);
- }
- f.close();
- getch();
- }
- void SEARCH()
- {
- clrscr();
- SHOWDATE();
- char str[40];
- int n;
- Q:
- clrscr();
- gotoxy(37,4);
- cout<<"SEARCH MENU";
- for(int i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(24,6);cout<<"TO SEARCH THE ELEMENT BY NAME";
- gotoxy(15,10);cout<<"2.";gotoxy(24,10);cout<<"TO SEARCH THE ELEMENT BY ATOMIC NUMBER";
- gotoxy(15,14);cout<<"3.";gotoxy(24,14);cout<<"TO SEARCH THE ELEMENT BY SYMBOL";
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,19);
- cout<<"==";
- gotoxy(24+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,20+i);cout<<"|";
- gotoxy(49,20+i);cout<<"|";
- gotoxy(54,20+i);cout<<"|";
- }
- gotoxy(26,20);
- cout<<"ENTER YOUR CHOICE";
- gotoxy(51,20);
- cin>>n;
- switch(n)
- { case 1:SEARCHBYNAME();break;
- case 2:SEARCHBYZ();break;
- case 3:SEARCHBYS();break;
- default:{ for(i=0;i<30;i++)
- {
- gotoxy(24+i,19);
- cout<<"==";
- gotoxy(24+i,21);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,20+i);cout<<"|";
- gotoxy(54,20+i);cout<<"|";
- }
- gotoxy(25,20);
- cout<<"PLEASE PROVIDE A VALID INPUNT";
- gotoxy(51,20);
- getch();
- goto Q;
- }
- }
- }
- void INPUT()
- { PERIODIC p1,p2;
- clrscr();
- SHOWDATE();
- p2.IN();
- fstream f1,f2;
- f1.open("data.dat",ios::in|ios::binary);
- f2.open("new.dat",ios::app|ios::binary);
- if(f1.fail())
- { cerr<<"\nUnable to open file";getch();
- exit(1);
- }
- if(f2.fail())
- { cerr<<"\nUnable to open file";getch();
- exit(1);
- }
- while(f1.read((char*)&p1,size))
- {
- if((p1.Z()-1)==p2.Z())
- {
- f2.write((char*)&p2,size);
- f2.write((char*)&p1,size);
- }
- else
- {
- f2.write((char*)&p1,size);
- }
- }
- f1.close();
- f2.close();
- remove("data.dat");
- rename("new.dat","data.dat");
- cout<<"\n\tElement added";
- getch();
- }
- void SHOW()
- { fstream f; PERIODIC p;
- clrscr();
- SHOWDATE();
- int n=1,k=0;
- char ch[2];
- clrscr();
- SHOWDATE();
- f.open("data.dat",ios::in|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open file.";
- getch();exit(1);
- }
- f.seekg(0,ios::end);
- n=f.tellg();
- if(n==0)
- { cout<<"\nNo element exist."; getch();
- return;
- }
- f.seekg(0,ios::beg);
- while(f.read((char*)&p,size))
- { if(k==0)
- clrscr();
- p.OUT();cout<<"\n";
- delay(800);
- k++;
- if(k%4==0)
- {
- cout<<"\nPress 'Q' to exit or else to continue......";
- gets(ch);
- if((strcmpi(ch,"Q")==0)||(strcmpi(ch,"q")==0))
- { clrscr();
- gotoxy(30,12);
- cout<<"THANK YOU FOR USING....";
- f.close();
- getch();return;
- }
- clrscr();
- }
- }
- getch();
- f.close();
- }
- void CREDIT()
- { clrscr();
- SHOWDATE();
- gotoxy(30,10);
- cout<<"Name: Harshita";
- gotoxy(30,11);
- cout<<"Class: XII-C";
- gotoxy(30,12);
- cout<<"Roll number: 9183188";
- delay(1000);
- gotoxy(30,14);
- cout<<"Name: Anton";
- gotoxy(30,15);
- cout<<"Class: XII-C";
- gotoxy(30,16);
- cout<<"Roll number: 9183187";
- delay(1000);
- gotoxy(30,18);
- cout<<"Name: Durvish";
- gotoxy(30,19);
- cout<<"Class: XII-C";
- gotoxy(30,20);
- cout<<"Roll number: 9183177";
- delay(1000);
- getch();
- }
- void load()
- {
- clrscr();
- int k,s=9;int m;int j;int n;
- clrscr();
- SHOWDATE();
- gotoxy(35,7);cout<<"LOADING...";
- gotoxy(27,10);cout<<"||";gotoxy(51,10);cout<<"||";
- for(int q=0;q<2;q++)
- { if(q==1)
- s=11;
- for(int w=27;w<52;w++)
- {
- gotoxy(w,s);
- cout<<"-";
- }
- }
- for(int a=0;a<3;a++)
- {
- k=10;m=n=30;
- for(int i=0;i<=20;i++)
- {
- if(i>=10)
- {
- gotoxy(n,k);
- delay(80);
- cout<<" ";
- n=n+2;
- }
- else
- {
- gotoxy(m,k);
- delay(80);
- cout <<"*";
- m =m+2;
- }
- }
- }
- gotoxy(33,10);
- cout<<"TAP TO CONTINUE";
- getch();
- }
- void ADMIN()
- { int n=0,ch;
- clrscr();
- fstream f;
- SHOWDATE();
- lock();
- SHOWDATE();
- textbackground(BLUE);
- textcolor(YELLOW);
- f.open("data.dat",ios::in|ios::app|ios::binary);
- if(f.fail())
- { cerr<<"\nUnable to open file";
- getch();
- exit(1);
- }
- f.seekg(0,ios::end);
- n=f.tellg();
- f.close();
- PERIODIC P;
- if(n==0)
- {
- P.INITIALISE(1,"Hydrogen","H",1.008,1,1,20.3,0.084,25,"1s1");
- P.INITIALISE(2,"Helium","Be",4.003,18,1,3750.0,1.85,105.0,"1s2");
- P.INITIALISE(3,"Lithium","Li",6.941,1,2,1615.0,0.53,145,"[He]2s1");
- P.INITIALISE(4,"Berylium","Be",9.012,2,2,3750,1.85,105,"[He]2s2");
- P.INITIALISE(5,"Boron","B",10.81,13,2,4200,2.46,85,"[He]2s2 2p1");
- P.INITIALISE(6,"Carbon","C",12.011,14,2,5100,3.51,70,"[He]2s2 2p2");
- P.INITIALISE(7,"Nitrogen","N",14.007,15,2,77.4,1.17,65,"[He]2s2 2p3");
- P.INITIALISE(8,"Oxygen","O",15.999,16,2,90.2,1.33,60,"[He]2s2 2p4");
- P.INITIALISE(9,"Fluorine","F",18.998,17,2,85.0,1.58,50,"[He]2s2 2p5");
- P.INITIALISE(10,"Neon","Ne",20.180,18,2,27.1,0.84,38,"[He]2s2 2p6");
- P.INITIALISE(11,"Sodium","Na",22.990,1,3,1156,0.97,180,"[Ne]3s1");
- P.INITIALISE(12,"Magnesium","Mg",24.305,2,3,1380,1.74,150,"[Ne]3s2");
- P.INITIALISE(13,"Aluminium","Al",26.920,13,3,1740,2.70,125,"[Ne]3s2 3p1");
- P.INITIALISE(14,"Silicon","Si",28.085,14,3,2628,2.33,110,"[Ne]3s2 3p2");
- P.INITIALISE(15,"Phosphorus","P",30.974,15,3,550,1.82,100,"[Ne]3s2 3p3");
- P.INITIALISE(16,"Sulphur","S",62.065,16,3,718,2.06,100,"[Ne]3s2 3p4");
- P.INITIALISE(17,"Chlorine","Cl",35.453,17,3,239,2.94,100,"[Ne]3s2 3p5");
- P.INITIALISE(18,"Argon","Ar",39.948,18,3,87,1.66,71,"[Ne]3s2 3p6");
- P.INITIALISE(19,"Potassium","K",39.098,1,4,1032,0.86,220,"[Ar]4s1");
- P.INITIALISE(20,"Calcium","Ca",40.078,2,4,1757,1.54,280,"[Ar]4s2");
- P.INITIALISE(21,"Scandium","Sc",44.956,3,4,3103,2.99,160,"[Ar]4s2 3d1");
- P.INITIALISE(22,"Titianium","Ti",47.867,4,4,3560,4.51,140,"[Ar]4s2 3d2");
- P.INITIALISE(23,"Vandium","V",50.942,5,4,3680,6.09,135,"[Ar]4s2 3d3");
- P.INITIALISE(24,"Chromium","Cr",51.996,6,4,2945,7.14,140,"[Ar]4s1 3d5");
- P.INITIALISE(25,"Manganese","Mn",54.938,7,4,2235,7.44,140,"[Ar]4s2 3d5");
- P.INITIALISE(26,"Iron","Fe",55.854,8,4,3023,7.87,140,"[Ar]4s2 3d6");
- P.INITIALISE(27,"Cobalt","Co",68.993,9,4,3200,8.89,135,"[Ar]4s2 3d7");
- P.INITIALISE(28,"Nickel","Ni",58.693,10,4,3186,8.91,135,"[Ar]4s2 3d8");
- P.INITIALISE(29,"Copper","Cu",63.456,11,4,2840,8.92,135,"[Ar]4s1 3d10");
- P.INITIALISE(30,"Zinc","Zn",65.39,12,4,1180,7.14,135,"[Ar]4s2 3d10");
- P.INITIALISE(31,"Gallium","Ga",69.723,13,4,2477,5.91,130.0,"[Ar]3d10 4s2 4p1");
- P.INITIALISE(32,"Germanium","Ge",72.64,14,4,3093,5.32,125.0,"[Ar]3d10 4s2 4p2");
- P.INITIALISE(33,"Arsenic","As",74.922,15,4,889,5.72,115.0,"[Ar]3d10 4s2 4p3");
- P.INITIALISE(34,"Selenium","Se",78.96,16,4,958,4.82,115.0,"[Ar]3d10 4s2 4p4");
- P.INITIALISE(35,"Bromine","Br",79.904,17,4,332,3.14,115.0,"[Ar]3d10 4s2 4p5");
- P.INITIALISE(36,"Krypton","Kr",83.8,18,4,120,3.48,88.0,"[Ar]3d10 4s2 4p6");
- P.INITIALISE(37,"Rubidium","Rb",85.468,1,5,961,1.53,235.0,"[Kr]5s1");
- P.INITIALISE(38,"Strontium","Sr",87.62,2,5,1655,2.63,200.0,"[Kr]5s2");
- P.INITIALISE(39,"Yttrium","Y",88.906,3,5,3609,4.47,18.0,"[Kr]4d1 5s2");
- P.INITIALISE(40,"Zirconcium","Zr",91.224,4,5,4682,6.51,155.0,"[Kr]4d2 5s2");
- P.INITIALISE(41,"Niobium","Nb",92.906,5 ,5,5017,8.58,145,"[Kr]4d4 5s1");
- P.INITIALISE(42,"Molybdenum","Mo",95.45,6 ,5,4912,10.28,145,"[Kr]4d5 5s1");
- P.INITIALISE(43,"Technetium","Tc",98,7 ,5 ,5150,11.49,135,"[Kr]4d5 5s2");
- P.INITIALISE(44,"Ruthenium","Ru",101.07,8 ,5,4423,12.45,130,"[Kr]4d7 5s1");
- P.INITIALISE(45,"Rhodium","Rh",102.91, 9,5,3968,12.41,135,"[Kr]4d8 5s1");
- P.INITIALISE(46,"Palladium","Pd",106.42,10 ,5,3236,12.02,140,"[Kr]4d10");
- P.INITIALISE(47,"Silver","Ag",107.87,11 ,5,2435,10.49,160,"[Kr]4d10 5s1");
- P.INITIALISE(48,"Cadmium","Cd",112.41,12 ,5,1040,8.64,155,"[Kr]4d10 5s2");
- P.INITIALISE(49,"Indium","In",114.82,13,5,2345,7.31,155,"[Kr]4d10 5s2 5p1");
- P.INITIALISE(50,"Tin","Sn",118.71,14,5,2875,7.29,145,"[Kr]4d10 5s2 5p2");
- P.INITIALISE(51,"Antimony","Sb",121.76,15,5,1860,6.69,145,"[Kr]4d10 5s2 5p3");
- P.INITIALISE(52,"Tellurium","Te",127.6,16,5,1263,6.25,140,"[Kr]4d10 5s2 5p4");
- P.INITIALISE(53,"Iodine","I",126.90,17,5,457,4.94,140,"[Kr]4d10 5s2 5p5");
- P.INITIALISE(54,"Xenon","Xe",131.29,18,5,165,4.49,108,"[Kr]4d10 5s2 5p6");
- P.INITIALISE(55,"Caesium","Cs",132.90,1,6,944,1.90,260,"[Xe]6s1");
- P.INITIALISE(56,"Barium","Ba",137.33,2,6,1913,3.65,215,"[Xe]6s2");
- P.INITIALISE(57,"Lanthanum","La",138.91,3 ,6,3730,6.16,195,"[Xe]5d1 6s2");
- P.INITIALISE(58,"Cerium","Ce",140.12,3,6,3716,6.77,185,"[Xe]4f1 5d1 6s2");
- P.INITIALISE(59,"Praseodymium","Pr",140.91,3 ,6,3793,6.48,185,"[Xe]4f3 6s2");
- P.INITIALISE(60,"Neodymium","Nd",144.24,3 ,6,3373,7.00,185,"[Xe]4f4 6s2");
- P.INITIALISE(61,"Promethium","Pm",145, 3, 6,3273,7.22,185,"[Xe]4f5 6s2");
- P.INITIALISE(62,"Samarium","Sm",150.36,3 ,6,2076,7.54,185,"[Xe]4f6 6s2");
- P.INITIALISE(63,"Europium","Eu",151.96, 3,6,1800,6.16,185,"[Xe]4f7 6s2");
- P.INITIALISE(64,"Gadolinium","Gd",157.25,3 ,6,3523,7.89,180,"[Xe]4f7 5d1 6s2");
- P.INITIALISE(65,"Terbium","Tb",158.92,3 ,6,3503,8.25,175,"[Xe]4f9 6s2");
- P.INITIALISE(66,"Dysprosium","Dy",162.5,3 ,6,2840,8.56,175,"[Xe]f410 6s2");
- P.INITIALISE(67,"Holmium","Ho",163.93, 3,6,2963,8.78,175,"[Xe]f411 6s2");
- P.INITIALISE(68,"Erbium","Er",167.26,3 ,6,2783,9.05,175,"[Xe]f412 6s2");
- P.INITIALISE(69,"Thulium","Tm",168.93,3 ,6,2220,9.32,175,"[Xe]f413 6s2");
- P.INITIALISE(70,"Ytterbium","Yb",173.04,3 ,6,1467,6.97,175,"[Xe]f414 6s2");
- P.INITIALISE(71,"Lutetium","Lu",174.97,3 ,6,3668,9.84,175,"[Xe]f414 6s2 5d1");
- P.INITIALISE(72,"Hafnium","Hf",178.49,4 ,6,4876,13.31,155,"[Xe]f4f14 6s2 5d2");
- P.INITIALISE(73,"Tantalum","Ta",180.95,5 ,6,5731,16.68,145,"[Xe]f4f14 6s2 5d3");
- P.INITIALISE(74,"Tungsten","W",183.84,6 ,6,5828,19.26,135,"[Xe]f4f14 6s2 5d4");
- P.INITIALISE(75,"Rhenium","Re",186.21, 7,6,5869,21.03,135,"[Xe]f4f14 6s2 5d5");
- P.INITIALISE(76,"Osmium","Os",190.23, 8,6,5285,22.61,130,"[Xe]f4f14 6s2 5d6");
- P.INITIALISE(77,"Iridium","Ir",192.22,9 ,6,4701,22.65,135,"[Xe]f4f14 6s2 5d7");
- P.INITIALISE(78,"Platinum","Pt",195.08,10 ,6,4100,21.45,135,"[Xe]f4f14 6s1 5d9");
- P.INITIALISE(79,"Gold","Au",196.97,11 ,6,3129,19.32,135,"[Xe]f4f14 6s1 5d10");
- P.INITIALISE(80,"Mercury","Hg",200.59,12 ,6,630,13.55,150,"[Xe]f4f14 6s2 5d10 6p1");
- P.INITIALISE(81,"Thallium","Tl",204.38,13,6,1746,11.85,190,"[Xe]f4f14 6s2 5d10 6p2");
- P.INITIALISE(82,"Lead","Pb",207.2,14,6,2023,11.34,180,"[Xe]f4f14 6s2 5d10 6p3");
- P.INITIALISE(83,"Bismuth","Bi",208.98,15,6 ,1837,9.80,160,"[Xe]f4f14 6s2 5d10 6p4");
- P.INITIALISE(84,"Polonium","Po",209,16,6 ,1235,9.20,190,"[Xe]f4f14 6s2 5d10 6p5");
- SHOWDATE();
- load();
- cout<<"\t\tElements created.";
- getch();
- }
- else
- { B:
- clrscr();
- SHOWDATE();
- gotoxy(37,1);
- cout<<"USER MENU";
- for(int i=0;i<16;i++)
- { gotoxy(12,2+i);
- cout<<"||";
- gotoxy(18,2+i);
- cout<<"||";
- gotoxy(70,2+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,2);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,4);
- cout<<"==";
- gotoxy(12+i,6);
- cout<<"==";
- gotoxy(12+i,10);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- gotoxy(12+i,14);
- cout<<"==";
- gotoxy(12+i,16);
- cout<<"==";
- gotoxy(12+i,18);
- cout<<"==";
- }
- gotoxy(15,3);cout<<"1.";gotoxy(24,3);cout<<"TO DISPLAY THE PERIODIC TABLE";
- gotoxy(15,5);cout<<"2.";gotoxy(24,5);cout<<"TO DELETE AN ELEMENT";
- gotoxy(15,7);cout<<"3.";gotoxy(24,7);cout<<"TO ENTER A NEW ELEMENT";
- gotoxy(15,9);cout<<"4.";gotoxy(24,9);cout<<"TO DISPLAY THE ELEMENTS";
- gotoxy(15,11);cout<<"5.";gotoxy(24,11);cout<<"TO MODIFY THE PROPERTIES";
- gotoxy(15,13);cout<<"6.";gotoxy(24,13);cout<<"TO SEARCH AN ELEMENT";
- gotoxy(15,15);cout<<"7.";gotoxy(24,15);cout<<"TO GO BACK TO THE MAIN MENU";
- gotoxy(15,17);cout<<"8.";gotoxy(24,17);cout<<"TO QUIT THE PROGRAM";
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,23);
- cout<<"==";
- gotoxy(24+i,25);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,24+i);cout<<"|";
- gotoxy(49,24+i);cout<<"|";
- gotoxy(54,24+i);cout<<"|";
- }
- gotoxy(26,24);
- cout<<"ENTER YOUR CHOICE";
- gotoxy(51,24);
- cin>>ch;
- switch(ch)
- z { case 1:DISPLAY();break;
- case 2:DELETE();break;
- case 3:INPUT();break;
- case 4:SHOW();break;
- case 5:MODIFY();break;
- case 6:SEARCH();break;
- case 7:break;
- case 8:{getch();exit(0);}
- default:{
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,23);
- cout<<"==";
- gotoxy(24+i,25);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,24+i);cout<<"|";
- gotoxy(49,24+i);cout<<"|";
- gotoxy(54,24+i);cout<<"|";
- }
- gotoxy(26,24);
- cout<<"INVALID INPUT";
- getch();
- goto B;
- }
- }
- }
- if(ch!=7)
- goto B;
- }
- void USER()
- { int n;
- textbackground(BLUE);
- textcolor(YELLOW);
- C:
- clrscr();
- SHOWDATE();
- gotoxy(37,1);
- cout<<"USER MENU";
- for(int i=0;i<22;i++)
- { gotoxy(12,2+i);
- cout<<"||";
- gotoxy(18,2+i);
- cout<<"||";
- gotoxy(70,2+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,2);
- cout<<"==";
- gotoxy(12+i,11);
- cout<<"==";
- gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,14);
- cout<<"==";
- gotoxy(12+i,17);
- cout<<"==";
- gotoxy(12+i,20);
- cout<<"==";
- gotoxy(12+i,23);
- cout<<"==";
- }
- gotoxy(15,3);cout<<"1.";gotoxy(24,3);cout<<"TO DISPLAY THE PERIODIC TABLE";
- gotoxy(15,6);cout<<"2.";gotoxy(24,6);cout<<"TO SEARCH AN ELEMENT";
- gotoxy(15,9);cout<<"3.";gotoxy(24,9);cout<<"TO COMPARE ANY TWO ELEMENTS";
- gotoxy(15,12);cout<<"4.";gotoxy(24,12);cout<<"TO DISPLAY AN ELEMENT";
- gotoxy(15,15);cout<<"5.";gotoxy(24,15);cout<<"MEET THE PROGRAMMERS";
- gotoxy(15,18);cout<<"6.";gotoxy(24,18);cout<<"TO GO BACK TO MAIN MENU";
- gotoxy(15,21);cout<<"7.";gotoxy(24,21);cout<<"TO QUIT THE PROGRAM";
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,23);
- cout<<"==";
- gotoxy(24+i,25);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,24+i);cout<<"|";
- gotoxy(49,24+i);cout<<"|";
- gotoxy(54,24+i);cout<<"|";
- }
- gotoxy(26,24);
- cout<<"ENTER YOUR CHOICE";
- gotoxy(51,24);
- cin>>n;
- switch(n)
- { case 1:{
- DISPLAY();
- goto C;
- }
- case 2:SEARCH();break;
- case 3:COMPARE();break;
- case 4:SHOW();break;
- case 5:CREDIT();break;
- case 6:break;
- case 7:exit(0);
- default:{
- cout<<"\nWRONG INPUT!";
- getch();
- goto C;
- }
- }
- if(n!=6)
- goto C;
- }
- void SHOWDATE()
- {
- char z[12][20]={"January","February","March","April","May","June","July","August","September","October","November","December"};
- date d;
- getdate(&d);
- gotoxy(65,1);
- cout<<(int)d.da_day<<" ";
- int l=d.da_mon;
- l=l-1;
- cout<<z[l]<<" ";
- cout<<d.da_year;
- }
- void main()
- {
- int choice;
- clrscr();
- ENTER();
- SHOWDATE();
- char ch;
- textbackground(BLUE);
- textcolor(YELLOW);
- do
- { textbackground(BLUE);
- textcolor(YELLOW);
- A:
- clrscr();
- clrscr();
- SHOWDATE();
- gotoxy(37,4);cout<<(char)9734<<"MAIN MENU"<<(char)9734;
- for(int i=0;i<10;i++)
- { gotoxy(12,5+i);
- cout<<"||";
- gotoxy(18,5+i);
- cout<<"||";
- gotoxy(70,5+i);
- cout<<"||";
- }
- for(i=0;i<59;i++)
- { gotoxy(12+i,5);
- cout<<"==";
- gotoxy(12+i,15);
- cout<<"==";
- gotoxy(12+i,8);
- cout<<"==";
- gotoxy(12+i,12);
- cout<<"==";
- }
- gotoxy(15,6);cout<<"1.";gotoxy(40,6);cout<<"ADMIN";
- gotoxy(15,10);cout<<"2.";gotoxy(40,10);cout<<"USER";
- gotoxy(15,14);cout<<"3.";gotoxy(40,14);cout<<"EXIT";
- for(i=0;i<30;i++)
- {
- gotoxy(24+i,23);
- cout<<"==";
- gotoxy(24+i,25);
- cout<<"==";
- }
- for(i=0;i<1;i++)
- {
- gotoxy(24,24+i);cout<<"|";
- gotoxy(49,24+i);cout<<"|";
- gotoxy(54,24+i);cout<<"|";
- }
- gotoxy(26,24);
- cout<<"ENTER YOUR CHOICE";
- gotoxy(51,24);
- cin>>choice;
- gotoxy(29,11);
- switch(choice)
- { case 1:{ADMIN();goto A; }
- case 2:{USER();goto A;}
- case 3:{getch();exit(0);}
- default:{
- gotoxy(10,12);
- cout<<"\nWRONG INPUT!";
- goto A;
- }
- }
- }while(ch=='y'||ch=='Y');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement