Information Technology
Project
C ++
Submitted By
Gaurav jatav
BCA 2nd Year
Dezyne E´cole College
www.dezyneecole.com
Submitted By
Gaurav Jatav
BCA – 2nd Year
Dezyne E´cole College
106/10, Civil Lines, Ajmer
Tel: 0145-2624679
www.dezyneecole.com
2016-2017
Topic: sequeiry System
Acknowledgement
This Website(College Website) create in “HTML & CSS” was developed at
Dezyne E’cole College.
During the making of this project I have learnt a lot and I thank my mentor
Mr. Tarun Sharma for helping us during the making of project.
I thank my college “Dezyne Ecole College” for helping us to bring out our
skill.
With due Regards,
Gaurav Jatav
BCA 2nd Year
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdio.h>
#include<dos.h>
#include<string.h>
#include<stdlib.h>
#include<graphics.h>
#include<fstream.h>
int x;
class menu
{
public:
int co,pas,id;
char jd[20],iid[20],idd[20];
char name[30],fn[30],c[30],m[30];
};
menu m,fp;
fstream s,f;
Layout :-
class lay
{
public:
int i,j,l;
char a[10];
//for Exit menu
int ex()
{
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
char q;
q=getch();
if(q=='E' || q=='e')
{
return 1;
}
else
{
return 0;
}
}
//password
void border1()
{
int i,j;
in();
head();
box();
for(i=20;i<=50;i++)
{
for(j=10;j<20;j++)
{
gotoxy(i,j);
textbackground(16);
cprintf(" ");
}
}
for(i=20;i<=50;i++)
{
for(j=10;j<=12;j++)
{
gotoxy(i,j);
textbackground(15);
cprintf(" ");
}
}
gotoxy(25,11);
textcolor(0);
cprintf("::PASSWORD CHECKER::");
for(i=27;i<=42;i++)
{
for(j=15;j<16;j++)
{
gotoxy(i,j);
textcolor(9);
cprintf(" ");
}
}
}
int get()
{
clrscr();
border1();
int c=0,n=0,s=0,l=0;
char cr;
char ch;
gotoxy(33,17);
textbackground(0);
textcolor(CYAN);
cprintf("Check");
gotoxy(26,14);
cout<<"::Enter Password:: ";
gotoxy(27,15);
while(1)
{
ch=getch();
if(ch==13)
{
break;
}
else if(l>10)
{
gotoxy(24,14) ;
textcolor(1);
cprintf("ACCEhPTING CANCEL");
gotoxy(24,15);
cprintf("Enter 10 Character Only");
}
a[l]=ch;
l++;
cout<<"*";
}
for(i=0;i<l;i++)
{
if((a[i]>=65&&a[i]<=90)||(a[i]>=97&&a[i]<=122))
{
c++;
}
else if(a[i]>=48&&a[i]>=57)
{
n++;
}
else
{
s++;
} }
if(c>=1&&n>=1&&s>=1)
{
cr=getch();
}
else
{
get();
}
if(cr=='c' || cr=='C')
{
return 1;
}
else
{
get();
}
}
void border()
{
for(i=0;i<=80;i++)
{
for(j=0;j<=25;j++)
{
gotoxy(i,j);
textbackground(15);
cprintf(" ");
}
}
for(i=5;i<=75;i++)
{
for(j=3;j<=23;j++)
{
gotoxy(i,j);
textbackground(0);
cprintf(" ");
}
}
for(i=5;i<=75;i++)
{
for(j=3;j<5;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
}
int check()
{
border();
gotoxy(32,4);
textbackground(1);
textcolor(15);
cprintf("SEQURITY SYSTEM");
gotoxy(28,7);
textbackground(0);
cprintf("1.Already user");
gotoxy(28,9);
textbackground(0);
cprintf("2.Create new account");
gotoxy(28,11);
textbackground(0);
cprintf("3.Exit");
int yl;
yl=getch();
if(yl=='1')
{
border();
gotoxy(32,4);
textbackground(1);
textcolor(15);
cprintf("SEQURITY SYSTEM");
gotoxy(28,7);
textbackground(0);
cprintf("USER ID");
gotoxy(28,9);
textbackground(0);
cprintf("PASSWORD");
for(i=38;i<=50;i++)
{
for(j=7;j<8;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
for(i=38;i<=50;i++)
{
for(j=9;j<10;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
for(i=31;i<=47;i++)
{
for(j=13;j<14;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
gotoxy(36,13);
textbackground(1);
textcolor(15);
cprintf("Log in");
gotoxy(32,16);
textbackground(0);
textcolor(1);
cprintf("Forgot Password");
char s[20];
for(i=31;i<=47;i++)
{
for(j=19;j<21;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
int t;
/* fstream f;
cin>>m.iid;
cin>>m.pas;
f.open("pass2.txt",ios::app);
f.write((char *)&m,sizeof(m));
f.close(); */
char r,w,a[20];
int ps;
char ud[20];
fstream f;
int l;
gotoxy(38,7);
cin>>ud;
gotoxy(38,9);
while(1)
{
ps=getch();
if(ps==13)
{
break;
}
a[l]=ps;
l++;
cout<<"*";
}
f.open("pass2.txt",ios::in);
while(f.read((char *)&m,sizeof(m)))
{
if(strcmp(ud,m.iid)==0)
{
// if(ps==m.pas)
// {
return 1;
/* }
else
{
return 0;
} */
}
else
{
return 0;
}
}
}
else if(yl=='2')
{
clrscr();
create();
}
else if(yl=='3')
{
exit(0);
}
else
{
clrscr();
check();
}
}
Create :-
void create()
{ clrscr();
border();
gotoxy(32,4);
cprintf("SEQURITY SYSTEM");
gotoxy(34,6);
textcolor(15);
cout<<"Join SMS";
gotoxy(24,8);
textcolor(15);
cout<<"We'll help you create a new";
gotoxy(26,9);
textcolor(15);
cout<<"account in a Easy steps";
for(i=33;i<45;i++)
{
for(j=11;j<12;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
gotoxy(37,11);
textbackground(1);
textcolor(15);
cprintf("N");
textcolor(0);
cprintf("EXT");
gotoxy(37,13);
textbackground(0);
textcolor(15);
cprintf("E");
textcolor(12);
cprintf("XIT");
char po;
po=getche();
if(po=='N' || po=='n')
{
next();
}
else if(po=='E' || po=='e')
{
exit(0);
}
else
{
clrscr();
create();
}
}
void next()
{
clrscr();
border();
gotoxy(32,4);
cprintf("SEQURITY SYSTEM");
gotoxy(32,6);
textcolor(15);
textbackground(0);
cprintf("NEW USER ACCOUNT");
gotoxy(28,8);
textcolor(15);
textbackground(0);
cprintf("USER ID");
for(i=44;i<60;i++)
{
for(j=8;j<9;j++)
{
gotoxy(i,j);
textbackground(15);
cprintf(" ");
}
}gotoxy(28,10);
textcolor(15);
textbackground(0);
cprintf("USER PASSWORD");
for(i=44;i<60;i++)
{
for(j=10;j<11;j++)
{
gotoxy(i,j);
textbackground(15);
cprintf(" ");
}
}
for(i=34;i<46;i++)
{
for(j=14;j<15;j++)
{
gotoxy(i,j);
textbackground(1);
cprintf(" ");
}
}
char op[20];
gotoxy(44,8);
cin>>m.idd;
gotoxy(44,10);
cin>>m.pas;
fstream f;
f.open("pass2.txt",ios::app);
f.write((char *)&m,sizeof(m));
f.close();
gotoxy(38,14);
textbackground(1);
textcolor(15);
cprintf("N");
textcolor(0);
cprintf("EXT");
gotoxy(37,16);
textbackground(1);
textcolor(15);
cprintf("E");
textcolor(0);
cprintf("XIT");
char pe;
pe=getch();
if(pe=='N' || pe=='n')
{
gotoxy(34,16);
textcolor(15);
textbackground(0);
cprintf("USER ACCOUNT WILL BE CREATED");
}
else if(pe=='E' || pe=='e')
{
clrscr();
create();
}
else
{
clrscr();
next();
}
f.close();
}
//Background
void back()
{
for(int i=0;i<25;i++)
{
for(int j=0;j<=80;j++)
{
textbackground(1);
gotoxy(j,i);
cprintf(" ");
}
}
}
void in()
{
back();
for(i=0;i<81;i++)
{
gotoxy(i,2);
cprintf(" ");
textbackground(7);
gotoxy(i,6);
cprintf(" ");
textbackground(7);
gotoxy(i,8);
cprintf(" ");
textbackground(7);
gotoxy(i,25);
cprintf(" ");
}
} void box()
{ for(int i=8;i<24;i++)
{ for(int j=1;j<=15;j++)
{ textbackground(0);
gotoxy(j,i);
cprintf(" ");
}
}
}
//for title and date
void head()
{
gotoxy(17,3);
textcolor(15);
textbackground(1);
cprintf("::::::::STUDENT MANAGEMENT SYSYTEM::::::::");
//date
struct date d;
getdate(&d);
gotoxy(65,5);
printf("%d/%d/%d",d.da_day,d.da_mon,d.da_year);
}void wel()
{ gotoxy(25,15);
textcolor(15);
textbackground(1);
cprintf("WELCOME TO STUDENT MANAGEMENT
SYSTEM");
}
void add()
{
clrscr();
in();
box();
head();
gotoxy(30,7);
textcolor(15);
textbackground(7);
cprintf(":::::STUDENT INFORMATION:::::");
gotoxy(25,10);
cout<<"ID::";
gotoxy(25,12);
cout<<"Name::";
gotoxy(25,14);
cout<<"Father name::";
gotoxy(25,16);
cout<<"Class::";
gotoxy(25,18);
cout<<"Mobile no::";
textbackground(1);
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
textbackground(1);
gotoxy(14,6);
textcolor(CYAN);
cprintf("S");
textcolor(15);
cprintf("TORE");
int z=getch();
if(z=='e' || z=='E')
{
main();
}
else if(z=='S' || z=='s')
{
gotoxy(40,10);
cin>>m.id;
bk:
gotoxy(40,12);
gets(m.name);
int i=0,k=0;
while(m.name[i]!='0')
{
f(m.name[i]>=65 && m.name[i]<=90 || m.name[i]>=97 &&
m.name[i]<=122)
{
k=1;
}
else
{
k=0;
break;
}
i++;
}
if(k==0)
{
j=0;
while(m.name[j]!='0')
{
j++;
}
gotoxy(40,12);
while(j>=0)
{
cout<<" ";
j--;
}
gotoxy(40,12);
goto bk;
}
gotoxy(38,14);
cout<<"Mr.";
kb:
gotoxy(41,14);
gets(m.fn);
int e=0,q=0,t;
while(m.fn[e]!='0')
{
if(m.fn[e]>=65 && m.fn[e]<=90
|| m.fn[e]>=97 && m.fn[e]<=122)
{
q=1;
}
else
{
q=0;
break;
}
e++;
}
if(q==0)
{
t=0;
while(m.fn[t]!='0')
{
t++;
}
gotoxy(41,14);
while(t>=0)
{
cout<<" ";
t--;
}
gotoxy(41,14);
goto kb;
}
bl:
gotoxy(40,16);
gets(m.c);
int ip=0,kp=0,jp;
while(m.c[ip]!='0')
{
if(m.c[ip]>=65 && m.c[ip]<=90 || m.c[ip]>=97 && m.c[ip]<=122)
{
kp=1;
}
else
{
kp=0;
break;
}
ip++;
}
if(kp==0)
{
jp=0;
while(m.c[jp]!='0')
{
jp++;
}
gotoxy(40,16);
while(jp>=0)
{
cout<<" ";
jp--;
}
gotoxy(40,16);
goto bl;
}
gotoxy(40,18);
char ch;
i=0;
textbackground(1);
while(1)
{
ch=getche();
if(ch==8 && i>0)
{
i--;
cprintf(" b");
}
else if(ch==13)
{
cprintf(" b");
}
else
{
m.m[i]=ch;
i++;
}
if(i==10)
{
break;
}
}
}
else
{
add();
add_in();
}
}
void add_in()
{
lay x;
fstream s;
s.open("file.txt",ios::out|ios::app);
s.write((char *)&m,sizeof(m));
gotoxy(32,19);
textcolor(15);
cprintf("Store in database....");
s.close();
}
CHEACK :-
void mn()
{
for(int i=16;i<=80;i++)
{
for(j=8;j<10;j++)
{
textbackground(0);
gotoxy(i,j);
cprintf(" ");
}
}
gotoxy(18,9);
cout<<"ID";
gotoxy(29,9);
cout<<"Name";
gotoxy(42,9);
cout<<"Fname";
gotoxy(55,9);
cout<<" Class";
gotoxy(67,9);
cout<<" Mobile no";
textbackground(1);
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
}
void ser()
{
gotoxy(1,9);
textcolor(7);
cprintf("---------------");
gotoxy(1,11);
textcolor(15);
cprintf(":Searching By:");
gotoxy(1,12);
textcolor(7);
cprintf("---------------");
gotoxy(3,13);
textcolor(CYAN);
cprintf("1.");
textcolor(15);
cprintf("ID");
gotoxy(3,14);
textcolor(CYAN);
cprintf("2.");
textcolor(15);
cprintf("Name");
gotoxy(3,15);
textcolor(CYAN);
cprintf("3.");
textcolor(15);
cprintf("Last Name");
textbackground(1);
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
}
void show()
{
clrscr();
gotoxy(25,10);
lay x;
fstream s;
in();
head();
box();
gotoxy(1,8);
textcolor(7);
cprintf("---------------");
gotoxy(2,9);
textcolor(15);
cprintf(":VIEW RECORD:");
gotoxy(1,10);
textcolor(7);
cprintf("---------------");
gotoxy(6,12);
textcolor(CYAN);
cprintf("1.");
textcolor(15);
cprintf("All");
gotoxy(4,14);
textcolor(CYAN);
cprintf("2.");
textcolor(15);
cprintf("Specific");
textbackground(1);
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
char cho;
cho=getch();
if(cho=='1')
{
for(int i=16;i<=80;i++)
{
for(j=8;j<10;j++)
{
textbackground(0);
gotoxy(i,j);
cprintf(" ");
}
}
textbackground(0);
gotoxy(i,j);
cprintf(" ");
}
}
textbackground(0);
gotoxy(i,j);
cprintf(" ");
}
}
gotoxy(18,9);
cout<<"ID";
gotoxy(29,9);
cout<<"Name";
gotoxy(42,9);
cout<<"Fname";
gotoxy(55,9);
cout<<" Class";
gotoxy(67,9);
cout<<" Mobile no";
s.open("file.txt",ios::in);
s.seekg(0,ios::beg);
while(s.read((char *)&m,sizeof(m)))
{
cout<<endl<<setw(18)<<m.id<<setw(16)<<m.name<<setw(10)<<
"Mr."<<m.fn<<setw(9)<<m.c<<setw(19)<<m.m<<endl;
}
s.close();
}
else if(cho=='2')
{
gotoxy(3,17);
int id;
textcolor(15);
textbackground(0);
cprintf("Enter id::");
cin>>id;
int c=0;
mn();
fstream s;
s.open("file.txt",ios::in);
gotoxy(1,10);
while(s.read((char *)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<setw(18)<<m.id<<setw(16)<<m.name<<setw(10)<<"Mr."<
<m.fn<<setw(9)<<m.c<<setw(19)<<m.m;
c++;
break;
}
}
if(c==0)
{
cout<<"nData not found";
}
}
else
{
gotoxy(32,18);
cout<<"Not valid...";
}
}
void search()
{
clrscr();
in();
head();
box();
gotoxy(1,8);
char ch;
char nm[30];
int id;
ser();
ch=getch();
if(ch=='1')
{
in();
head();
box();
ser();
lay x;
int c=0;
mn();
gotoxy(2,17);
textcolor(15);
textbackground(0);
cprintf("Enter id::");
textcolor(15);
gotoxy(4,18);
cin>>id;
fstream s;
s.open("file.txt",ios::in);
gotoxy(1,10);
while(s.read((char *)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<setw(18)<<m.id<<setw(16)<<m.name<<setw(10)<<"Mr."<
<m.fn<<setw(9)<<m.c<<setw(19)<<m.m;
c++;
break;
}
}
if(c==0)
{
cout<<"nData not found";
}
}
else if(ch=='2')
{
in();
head();
box();
ser();
gotoxy(2,17);
textcolor(15);
textbackground(0);
cprintf("Enter name::n");
textcolor(15);
gotoxy(4,18);
cin>>nm;
lay x;
int c=0;
mn();
fstream s;
s.open("file.txt",ios::in);
gotoxy(1,9);
while(s.read((char *)&m,sizeof(m)))
{
if(strcmp(m.name,nm)==0)
{
cout<<"n";
cout<<setw(18)<<m.id<<setw(16)<<m.name<<setw(10)<<"Mr."<
<m.fn<<setw(9)<<m.c<<setw(19)<<m.m;
c++;
}
}
}
else if(ch=='3')
{
in();
head();
box();
ser();
char fa[30];
gotoxy(1,17);
textcolor(15);
textbackground(0);
textcolor(15);
gotoxy(1,18);
cprintf("MR.");
gotoxy(4,18);
cin>>fa;
lay x;
int c=0;
mn();
fstream s;
s.open("file.txt",ios::in);
gotoxy(1,9);
while(s.read((char *)&m,sizeof(m)))
{
if(strcmp(m.fn,fa)==0)
{
cout<<"n";
cout<<setw(18)<<m.id<<setw(16)<<m.name<<setw(10)<<"Mr."<
<m.fn<<setw(9)<<m.c<<setw(19)<<m.m;
c++;
}
}
}
cprintf("Enter Fname::n");
else
{
cout<<"Not accessable....";
}
}
void modi()
{
gotoxy(1,8);
cout<<"---------------";
gotoxy(1,10);
cout<<":::::MODIFY::::";
gotoxy(1,11);
cout<<"---------------";
gotoxy(4,13);
textcolor(CYAN);
cprintf("1.");
cout<<"All data";
gotoxy(4,15);
textcolor(CYAN);
cprintf("2.");
cout<<"Name";
gotoxy(4,17);
textcolor(CYAN);
cprintf("3.");
cout<<"Fname";
gotoxy(4,19);
textcolor(CYAN);
cprintf("4.");
cout<<"Mobile no";
gotoxy(4,21);
textcolor(CYAN);
cprintf("5.");
cout<<"Class";
}
void modify()
{
clrscr();
in();
head();
box();
modi();
char t;
int id;
t=getch();
gotoxy(2,21);
fstream f;
fstream s;
if(t=='1')
{
gotoxy(2,21);
cprintf("Enter id:: ");
gotoxy(2,21);
cin>>id;
int c=0;
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
while(s.read((char*)&m,sizeof(m)))
{
if(id==m.id)
{
in();
box();
head();
gotoxy(30,7);
textcolor(15);
textbackground(7);
cprintf(":::::STUDENT INFORMATION:::::");
gotoxy(25,10);
cout<<"ID::";
gotoxy(25,12);
cout<<"Name::";
gotoxy(25,14);
cout<<"Father name::";
gotoxy(25,16);
cout<<"Class::";
gotoxy(25,18);
cout<<"Mobile no::";
textbackground(1);
gotoxy(4,6);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
textbackground(1);
gotoxy(14,6);
textcolor(CYAN);
cprintf("S");
textcolor(15);
cprintf("TORE");
int z=getch();
if(z=='e' || z=='E')
{
main();
}
else if(z=='S' || z=='s')
{
gotoxy(40,10);
cin>>m.id;
bk:
gotoxy(40,12);
gets(m.name);
int i=0,k=0;
while(m.name[i]!='0')
{
if(m.name[i]>=65 && m.name[i]<=90 || m.name[i]>=97 &&
m.name[i]<=122)
{
k=1;
}
else
{
k=0;
break;
}
i++;
}
if(k==0)
{
j=0;
while(m.name[j]!='0')
{
j++;
}
gotoxy(40,12);
while(j>=0)
{
cout<<" ";
j--;
}
gotoxy(40,12);
goto bk;
}
gotoxy(38,14);
cout<<"Mr.";
kb:
gotoxy(41,14);
gets(m.fn);
int e=0,q=0,t
while(m.fn[e]!='0')
{
if(m.fn[e]>=65 && m.fn[e]<=90 || m.fn[e]>=97 && m.fn[e]<=122)
{
q=1;
}
else
{
q=0;
break;
}
e++;
};
if(q==0)
{
t=0;
while(m.fn[t]!='0')
{
t++;
}
gotoxy(41,14);
while(t>=0)
{
cout<<" ";
t--;
}
gotoxy(41,14);
goto kb;
}
bl:
gotoxy(40,16);
gets(m.c);
int ip=0,kp=0,jp;
while(m.c[ip]!='0')
{
if(m.c[ip]>=65 && m.c[ip]<=90 || m.c[ip]>=97 && m.c[ip]<=122)
{
kp=1;
}
else
{ kp=0;
break;
}
ip++;
}
if(kp==0)
{ jp=0;
while(m.c[jp]!='0')
{
jp++;
}
gotoxy(40,16);
while(jp>=0)
{
cout<<" ";
jp--;
}
gotoxy(40,16);
goto bl;
}
gotoxy(40,18);
char ch;
i=0;
textbackground(1);
while(1)
{
ch=getche();
if(ch==8 && i>0)
{
i--;
cprintf(" b");
}
else if(ch==13)
{
cprintf(" b");
}
else
{
m.m[i]=ch;
i++;
}
if(i==10)
{
break;
}
}
}
else
{
add();
add_in();
}
f.write((char*)&m,
sizeof(m));
c++;
}
else
{
f.write((char*)&m,
sizeof(m));
}
}
if(c==0)
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is not
available");
}
else
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is Modify");
}
f.close();
s.close();
remove("file.txt");
rename("nfile.txt","file.txt");
}
else if(t=='2')
{
gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
int c=0;
char name[30];
fstream s;
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
while(s.read((char*)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<"Enter
name::";
ql:
gotoxy(2,23);
gets(m.name);
int
i=0,k=0;
while(m.name[i]!='0')
{
if(m.name[i]>=65 && m.name[i]<=90 || m.name[i]>=97 &&
m.name[i]<=122)
{
k=1;
}
else
{
k=0;
break;
}
++;
}
if(k==0)
{
j=0;
while(m.name[j]!='0')
{
j++;
}
gotoxy(2,23);
while(j>=0)
{
cout<<" ";
j--;
}
gotoxy(2,23);
goto ql;
}
f.write((char*)&m, sizeof(m));
c++;
gotoxy(40,21);
cout<<"Record modify..";
}
else
{
f.write((char*)&m, sizeof(m));
}
}
if(c==0)
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is not available");
}
else
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is Modify");
}
f.close();
s.close();
remove("file.txt");
rename("nfile.txt","file.txt");
}
else if(t=='3')
{gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
int c=0;
char name[30];
fstream s;
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
while(s.read((char*)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<"Enter
name::";
gotoxy(2,23);
cout<<"Mr.";
kl:
gotoxy(2,26);
gets(m.fn);
int e=0,q=0,t;
while(m.fn[e]!='0')
{
if(m.fn[e]>=65 && m.fn[e]<=90
|| m.fn[e]>=97 && m.fn[e]<=122)
{
q=1;
}
else
{
q=0;
break;
}
e++;
}
if(q==0)
{
t=0;
while(m.fn[t]!='0')
{
t++;
}
gotoxy(2,23);
while(t>=0)
{
cout<<" ";
t--;
}
gotoxy(2,23);
goto kl;
}
f.write((char*)&m, sizeof(m));
c++;
}
else
{
f.write((char*)&m, sizeof(m));
}
}
if(c==0)
{
textcolor(15);
textbackground(1);
gotoxy(40,11);
cprintf("Record is not available");
}
else
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is Modify");
}
f.close();
s.close();
remove("file.txt");
rename("nfile.txt","file.txt");
}
else if(t=='5')
{
gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
int c=0;
char name[30];
fstream s;
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
while(s.read((char*)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<"Enter
class::";
cin>>m.c;
f.write((char*)&m,
sizeof(m));
c++;
}
else
{
f.write((char*)&m,
sizeof(m));
}
}
if(c==0)
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is not
available");
}
else
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is Modify");
}
f.close();
s.close();
remove("file.txt");
rename("nfile.txt","file.txt");
}
else if(t=='4')
{
gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
int c=0;
char name[30];
fstream s;
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
while(s.read((char*)&m,sizeof(m)))
{
if(id==m.id)
{
cout<<"Enter
mobile::";
gotoxy(2,24);
char ch;
i=0;
textbackground(1);
while(1)
{
ch=getche();
if(ch==8 && i>0)
{
i--;
cprintf(" b");
}
else if(ch==13)
{
cprintf(" b");
}
else
{
m.m[i]=ch;
i++;
}
if(i==10)
{
break;
}
}
f.write((char*)&m, sizeof(m));
c++;
}
else
{
f.write((char*)&m, sizeof(m));
}
}
if(c==0)
{
textcolor(15);
textbackground(1);
gotoxy(40,11);
cprintf("Record is not available");
}
else
{
textcolor(15);
textbackground(1);
gotoxy(40,21);
cprintf("Record is Modify");
}
f.close();
s.close();
remove("file.txt");
rename("nfile.txt","file.txt");
}
}
//for menu
//for searching menu
textbackground(0);
gotoxy(i,j);
cprintf(" ");
}
}
//for modify menus
void del()
{
clrscr();
in();
head();
box();
gotoxy(1,8);
cout<<"---------------";
gotoxy(1,9);
cout<<":DELETE RECORD:";
gotoxy(1,10);
cout<<"---------------";
gotoxy(6,12);
textcolor(CYAN);
cprintf("1.");
textcolor(15);
cprintf("All");
gotoxy(4,14);
textcolor(CYAN);
cprintf("2.");
textcolor(15);
cprintf("Specific");
int t;
int id;
fstream s,z;
t=getch();
if(t=='1')
{
gotoxy(2,21);
cout<<"Enter id::";
int u;
u=get();
if(u==1)
{
s.open("file.txt",ios::in);
f.open("file1.txt",ios::out);
z.open("dfile.txt",ios::out|ios::app);
while(s.read((char
*)&m,sizeof(m)))
{
gotoxy(40,21);
textcolor(15);
textbackground(1);
z.write((char *)&m,sizeof(m));
cout<<"Data will be deleted...";
z.close();
f.close();
s.close();
remove("file.txt");
rename("file1.txt","file.txt");
}
}
}
if(t=='2')
{
int id;
int c=0,y;
gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
y=get();
if(y==1)
{
s.open("file.txt",ios::in);
f.open("nfile.txt",ios::out);
z.open("dfile.txt",ios::out|ios::app);
while(s.read((char*)&m,sizeof(m))) {
if(id==m.id)
{
c=1;
textcolor(15);
gotoxy(40,21);
textbackground(1);
z.write((char *)&m,sizeof(m));
cprintf("Record delete");
}
void restore()
{
in();
box();
head();
gotoxy(1,8);
textcolor(7);
textbackground(0);
cprintf("---------------");
gotoxy(2,9);
textcolor(7);
cprintf(":::RESTORE:::");
gotoxy(1,10);
textcolor(7);
textbackground(0);
cprintf("---------------");
gotoxy(4,12);
textcolor(CYAN);
cprintf("1.");
textcolor(15);
cprintf("All DATA");
gotoxy(4,14);
textcolor(CYAN);
cprintf("2.");
textcolor(15);
cprintf("Specific");
fstream z,s,q;
int p=0;
int xp;
xp=getch();
if(xp=='1')
{
z.open("dfile.txt",ios::in);
s.open("file.txt",ios::out|ios::app);
q.open("tfile.txt",ios::out|ios::app);
while(z.read((char *)&m,sizeof(m)))
{
p++;
s.write((char *)&m,sizeof(m));
gotoxy(41,21);
cout<<"Rstoration
complite........";
}
if(p==0)
{
gotoxy(41,21);
cout<<"Sorry.Not data in
file..";
}
q.close();
s.close();
z.close();
remove("dfile.txt");
rename("tfile.txt","dfile.txt");
}
else if(xp=='2')
{
int id;
gotoxy(2,21);
cout<<"Enter id::";
cin>>id;
z.open("dfile.txt",ios::in);
s.open("file.txt",ios::out|ios::app);
q.open("rfile.txt",ios::out|ios::app);
while(z.read((char *)&m,sizeof(m)))
{
if(id==m.id)
{
p++;
s.write((char
*)&m,sizeof(m));
gotoxy(41,21);
cout<<"Rstoration
complite........";
}
else
{
q.write((char
*)&m,sizeof(m));
}
}
if(p==0)
{
gotoxy(41,21);
cout<<"Sorry.Not data in file..";
}
q.close();
s.close();
z.close();
remove("dfile.txt");
rename("rfile.txt","dfile.txt");
}
}
};
MAIN :-
void main()
{
lay l;
clrscr();
int b;
b=l.check();
if(b==1)
{
r:
l.in();
l.head();
l.box();
l.wel();
gotoxy(1,8);
textcolor(7);
textbackground(0);
cprintf("---------------");
gotoxy(1,9);
textcolor(7);
cprintf(":::::MENUS:::::");
gotoxy(1,10);
textcolor(7);
textbackground(0);
cprintf("---------------");
gotoxy(4,11);
textcolor(CYAN);
textbackground(0);
cprintf("A");
textcolor(15);
cprintf("DD DATA");
gotoxy(4,13);
textcolor(CYAN);
cprintf("V");
textcolor(15);
cprintf("IEW DATA");
gotoxy(3,15);
textcolor(CYAN);
cprintf("D");
textcolor(15);
cprintf("ELETE DATA");
gotoxy(3,17);
textcolor(CYAN);
cprintf("M");
textcolor(15);
cprintf("ODIFY DATA");
gotoxy(3,19);
textcolor(CYAN);
cprintf("S");
textcolor(15);
cprintf("EARCH DATA");
gotoxy(3,21);
textcolor(CYAN);
cprintf("R");
textcolor(15);
cprintf("ESTORE DATA");
gotoxy(6,23);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
gotoxy(58,24.5);
textcolor(CYAN);
cprintf("D");
textcolor(15);
cprintf("ESIGN BY::Gaurav Jatav");
char c;
c=getch();
if(c=='a' || c=='A')
{
l.add();
l.add_in();
getch();
goto r;
}
else if(c=='v' || c=='V')
{
clrscr();
l.show();
getch();
goto r;
}
else if(c=='s' || c=='S')
{
clrscr();
l.search();
getch();
goto r;
}
else if(c=='m'|| c=='M')
{
cprintf("R");
textcolor(15);
cprintf("ESTORE DATA");
gotoxy(6,23);
textcolor(CYAN);
cprintf("E");
textcolor(15);
cprintf("XIT");
gotoxy(58,24.5);
textcolor(CYAN);
cprintf("D");
textcolor(15);
cprintf("ESIGN BY::Gaurav Jatav");
char c;
c=getch();
if(c=='a' || c=='A')
{
l.add();
l.add_in();
getch();
goto r;
}
else if(c=='v' || c=='V')
{
clrscr();
l.show();
getch();
goto r;
}
else if(c=='s' || c=='S')
{
clrscr();
l.search();
getch();
goto r;
}
else if(c=='m'|| c=='M')
{
clrscr();
l.modify();
getch();
goto r;
}
else if(c=='d'|| c=='D')
{
clrscr();
l.del();
getch();
goto r;
}
else if(c=='R' || c=='r')
{
clrscr();
l.restore();
getch();
goto r;
}
else if(c=='e'|| c=='E')
{
exit(0);
}
else
{
goto r;
}
}
else if(b==0)
{
clrscr();
l.check();
}
else
{
clrscr();
l.check();
}
getch();
}
Thank You…

Gaurav Jatav , BCA Third Year