SUBMITED BY
Bhanu Pratap Singh Shekhawat
Bachelor of Computer Application II YEAR
Dezyne E’cole College
www.dezyneecolecollege
INFORMATION TECHNOLOGY
PROJECT REPORT
C++ PROGRAMMING
NAME LIST GENERATOR
TOPIC
C++
Project Report
On
C++ Programming
At
Dezyne E’cole College
Ajmer
Submitted to
Dezyne E’cole College
Towards the
Partial Fulfillment on
Bachelor of Computer Application
By
Bhanu Pratap Singh Shekhawat
Dezyne E’cole College
106/10 Civil Line, Ajmer
Tel – 0145-2624679
Www.dezyneecole.com
2016
Acknowledgement
I Bhanu Pratap Singh Shekhawat, Student On Dezyne E’cole College,
An Extremely Grateful To Each And Every Individual. Who Has
Contributed. In Successful Completion Of My Project. I Express My
Gratitude Towards Dezyne E’cole College For Their. Guidance and
Contrast Supervision As Well As For Providing The Necessary
Information And Support Regarding The Completion Of Project
Thank You
Synopsis
This Project Is A Minor. Project Made, Based On The Practical Concept
Of C++ This Project Has Made Our Basic Practical Concepts On C++
Strong
1 | P a g e
Name List Generator
2 | P a g e
3 | P a g e
4 | P a g e
5 | P a g e
6 | P a g e
7 | P a g e
8 | P a g e
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<string.h>
#include<dos.h>
#include<stdlib.h>
#include<stdio.h>
class student
{
public:
char id[60];
char na[60];
char fna[60];
char d[60];
char ci[60];
char ph[60];
};
class admin
{
public:
char id[60];
char pass[60];
};
fstream of,tf,bf;
student mf,mf2;
admin af,af1;
void main()
{
class use
{
public:
char tid[60];
void checkid()
{
int count=0;
of.open("detail.dat",ios::in);
if(of.fail())
{
remove("tid.dat");
}
else
{
while(of.read((char *) &mf, sizeof mf))
9 | P a g e
{
if(of==0)
{
break;
}
count++;
}
}
of.close();
if(count==0)
{
remove("tid.dat");
remove("detail.dat");
remove("backup.dat");
}
}
void add_menu()
{
textcolor(7);
gotoxy(38,5);
cprintf("Enter Student detail");
gotoxy(30,8);
cprintf("Id ::");
gotoxy(30,10);
cprintf("Name ::");
gotoxy(30,12);
cprintf("Father name ::");
gotoxy(30,14);
cprintf("Department ::");
gotoxy(30,16);
cprintf("City ::");
gotoxy(30,18);
cprintf("Phone no. ::");
textcolor(4);
gotoxy(43,21);
cprintf("S");
gotoxy(50,21);
cprintf("C");
textcolor(7);
gotoxy(44,21);
cprintf("ave");
gotoxy(51,21);
10 | P a g e
cprintf("ancel");
}
void add_student()
{
textcolor(7);
/* clrscr();
white();
menu_main();
window();
add_menu(); */
int id2;
of.open("tid.dat",ios::in);
tf.open("detail.dat",ios::in);
if(of.fail())
{
if(tf.fail())
{
id2=1;
gotoxy(36,8); //id
cprintf("%d",id2);
}
else
{
while(tf.read((char *) &mf, sizeof mf))
{
}
id2=0; //convert char to int
for(int j=0;mf.id[j]!='0';j++)
{
id2=id2*10+(mf.id[j]-48);
}
id2++;
}
}
else
{
of>>tid;
id2=0; //convert char to int
for(int j=0;tid[j]!='0';j++)
{
11 | P a g e
id2=id2*10+(tid[j]-48);
}
id2++;
}
tf.close();
of.close();
gotoxy(36,8); //id
cprintf("%d",id2);
int m,t,t1,i,co=0; //convert int to char
t=t1=id2;
while(t1>0)
{
co++;
t1=t1/10;
}
i=co-1;
while(t>0)
{
m=t%10;
tid[i]=m+48;
i--;
t=t/10;
}
tid[co]='0';
gotoxy(36,8); //id
cprintf("%s",tid);
strcpy(mf.id,tid);
gotoxy(38,10); //name
// gets(mf.na); //name
int ic=-1; //name
while(mf.na[ic]!=13)
{
ic++;
mf.na[ic]=getch();
cprintf("%c",mf.na[ic]);
if((mf.na[ic]>=65 && mf.na[ic]<=90) ||
(mf.na[ic]>=97 && mf.na[ic]<=122) || mf.na[ic]==' ' || mf.na[ic]==13 ||
mf.na[ic]==8)
{
}
else
{
12 | P a g e
cout<<"b b";
ic-=1;
}
if(mf.na[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf.na[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf.na[ic]='0';
gotoxy(45,12); //father name
// gets(mf.fna);
ic=-1; //father name
while(mf.fna[ic]!=13)
{
ic++;
mf.fna[ic]=getch();
cprintf("%c",mf.fna[ic]);
if((mf.fna[ic]>=65 && mf.fna[ic]<=90) ||
(mf.fna[ic]>=97 && mf.fna[ic]<=122) || mf.fna[ic]==' ' || mf.fna[ic]==13 ||
mf.fna[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf.fna[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf.fna[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
13 | P a g e
}
}
mf.fna[ic]='0';
gotoxy(44,14); //department
// gets(mf.d);
ic=-1; //department
while(mf.d[ic]!=13)
{
ic++;
mf.d[ic]=getch();
cprintf("%c",mf.d[ic]);
if((mf.d[ic]>=65 && mf.d[ic]<=90) || (mf.d[ic]>=97
&& mf.d[ic]<=122) || mf.d[ic]==' ' || mf.d[ic]==13 || mf.d[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf.d[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf.d[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf.d[ic]='0';
gotoxy(38,16); //city
// gets(mf.ci);
ic=-1; //city
while(mf.ci[ic]!=13)
{
ic++;
mf.ci[ic]=getch();
cprintf("%c",mf.ci[ic]);
14 | P a g e
if((mf.ci[ic]>=65 && mf.ci[ic]<=90) || (mf.ci[ic]>=97
&& mf.ci[ic]<=122) || mf.ci[ic]==' ' || mf.ci[ic]==13 || mf.ci[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf.ci[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf.ci[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf.ci[ic]='0';
gotoxy(43,18); //phone no.
// gets(mf.ph);
ic=-1; //phone no.
while(mf.ph[ic]!=13)
{
ic++;
mf.ph[ic]=getch();
cprintf("%c",mf.ph[ic]);
if((mf.ph[ic]>=48 && mf.ph[ic]<=57) || mf.ph[ic]=='
' || mf.ph[ic]==13 || mf.ph[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf.ph[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
15 | P a g e
}
if(mf.ph[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
if(ic==9)
{
ic++;
char c;
bk:
c=getch();
if(c==13)
{
break;
}
else
{
goto bk;
}
}
}
mf.ph[ic]='0';
gotoxy(43,21);
}
void save()
{
of.open("detail.dat",ios::out | ios::app);
of.write((char *) &mf, sizeof mf);
of.close();
of.open("tid.dat",ios::out);
of<<tid;
of.close();
}
void out()
{
outprint();
int i=7;
of.open("detail.dat",ios::in);
if(of.fail())
{
gotoxy(30,i);
cprintf("Record not available");
16 | P a g e
}
else
{
while(of.read((char *) &mf, sizeof mf))
{
gotoxy(25,i);
cprintf("%s",mf.id);
gotoxy(34,i);
cprintf("%s",mf.na);
i++;
if(i==22)
{
getch();
i=7;
window();
outprint();
}
}
}
of.close();
}
void outprint()
{
textcolor(7);
gotoxy(25,5);
cprintf("Id");
gotoxy(34,5);
cprintf("Name");
for(int i=5;i<=23;i++)
{
for(int j=22;j<=75;j++)
{
if(j==29)
{
gotoxy(j,i);
cprintf("%c",179);
}
}
}
}
void search_student()
{
textcolor(7);
17 | P a g e
gotoxy(25,5);
cprintf("Enter Id :::: ");
gets(tid);
int c=0;
of.open("detail.dat",ios::in);
if(of.fail())
{
gotoxy(25,7);
cprintf("File not available");
}
else
{
while(of.read((char *) &mf, sizeof mf))
{
if(strcmp(mf.id,tid)==0)
{
window();
gotoxy(38,7);
cprintf("Student detail");
gotoxy(30,9);
cprintf("Id ::");
gotoxy(30,11);
cprintf("Name ::");
gotoxy(30,13);
cprintf("Father name ::");
gotoxy(30,15);
cprintf("Department ::");
gotoxy(30,17);
cprintf("City ::");
gotoxy(30,19);
cprintf("Phone no. ::");
gotoxy(36,9); //id
cprintf("%s",mf.id);
gotoxy(38,11); //name
cprintf("%s",mf.na);
gotoxy(45,13); //father name
cprintf("%s",mf.fna);
gotoxy(44,15); //department
cprintf("%s",mf.d);
gotoxy(38,17); //city
cprintf("%s",mf.ci);
gotoxy(43,19); //phone no.
cprintf("%s",mf.ph);
18 | P a g e
c=1;
}
}
of.close();
if(c==0)
{
gotoxy(25,7);
cprintf("Id not available");
}
}
}
void delete_student()
{
textcolor(7);
gotoxy(25,5);
cprintf("Enter Id you want to delete :::: ");
gets(tid);
textcolor(4);
gotoxy(42,21);
cprintf("D");
gotoxy(51,21);
cprintf("C");
textcolor(7);
gotoxy(43,21);
cprintf("elete");
gotoxy(52,21);
cprintf("ancel");
char o;
bk:
o=getch();
if(o=='d' || o=='D')
{
goto en;
}
else if(o=='c' || o=='C')
{
return;
}
else
{
goto bk;
19 | P a g e
}
en:
int c=0;
of.open("detail.dat",ios::in);
tf.open("temp.dat",ios::out | ios::app);
bf.open("backup.dat",ios::out | ios::app);
if(of.fail())
{
gotoxy(25,7);
cprintf("File not available");
}
else
{
while(of.read((char *) &mf, sizeof mf))
{
if(strcmp(mf.id,tid)==0)
{
gotoxy(40,7);
cprintf("Data deleted");
gotoxy(30,9);
cprintf("Id ::");
gotoxy(30,11);
cprintf("Name ::");
gotoxy(30,13);
cprintf("Father name ::");
gotoxy(30,15);
cprintf("Department ::");
gotoxy(30,17);
cprintf("City ::");
gotoxy(30,19);
cprintf("Phone no. ::");
gotoxy(36,9); //id
cprintf("%s",mf.id);
gotoxy(38,11); //name
cprintf("%s",mf.na);
gotoxy(45,13); //father name
cprintf("%s",mf.fna);
gotoxy(44,15); //department
cprintf("%s",mf.d);
gotoxy(38,17); //city
cprintf("%s",mf.ci);
gotoxy(43,19); //phone no.
cprintf("%s",mf.ph);
20 | P a g e
c=1;
bf.write((char *) &mf, sizeof mf);
}
else
{
tf.write((char *) &mf, sizeof mf);
}
}
bf.close();
tf.close();
of.close();
remove("detail.dat");
rename("temp.dat","detail.dat");
if(c==0)
{
gotoxy(25,22);
cprintf("Data not Found");
}
}
}
void modify_student()
{
textcolor(7);
gotoxy(25,5);
cprintf("Enter Id you want to Modify :::: ");
gets(tid);
gotoxy(30,7);
cprintf("You want to modify data to select option");
textcolor(4);
gotoxy(42,21);
cprintf("M");
gotoxy(51,21);
cprintf("C");
textcolor(7);
gotoxy(43,21);
cprintf("odify");
gotoxy(52,21);
cprintf("ancel");
char o;
bk:
o=getch();
if(o=='m' || o=='M')
{
21 | P a g e
goto en;
}
else if(o=='c' || o=='C')
{
return;
}
else
{
goto bk;
}
en:
window();
int c=0,ch=0;
of.open("detail.dat",ios::in);
if(of.fail())
{
gotoxy(25,9);
cprintf("File not available");
}
else
{
while(of.read((char *) &mf, sizeof mf))
{
if(strcmp(tid,mf.id)==0)
{
ch=1;
}
}
of.close();
if(ch==0)
{
gotoxy(25,9);
cprintf("Record not available");
getch();
return;
}
of.open("detail.dat",ios::in);
tf.open("temp.dat",ios::out | ios::app);
gotoxy(38,7);
cprintf("Enter new detail");
gotoxy(30,9);
cprintf("Id ::");
22 | P a g e
gotoxy(30,11);
cprintf("Name ::");
gotoxy(30,13);
cprintf("Father name ::");
gotoxy(30,15);
cprintf("Department ::");
gotoxy(30,17);
cprintf("City ::");
gotoxy(30,19);
cprintf("Phone no. ::");
gotoxy(36,9); //id
strcpy(mf2.id,tid);
cprintf("%s",mf2.id);
gotoxy(38,11); //name
// gets(mf2.na);
int ic=-1; //name
while(mf2.na[ic]!=13)
{
ic++;
mf2.na[ic]=getch();
cprintf("%c",mf2.na[ic]);
if((mf2.na[ic]>=65 && mf2.na[ic]<=90) ||
(mf2.na[ic]>=97 && mf2.na[ic]<=122) || mf2.na[ic]==' ' || mf2.na[ic]==13 ||
mf2.na[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf2.na[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf2.na[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf2.na[ic]='0';
23 | P a g e
gotoxy(45,13); //father name
// gets(mf2.fna);
ic=-1; //father name
while(mf2.fna[ic]!=13)
{
ic++;
mf2.fna[ic]=getch();
cprintf("%c",mf2.fna[ic]);
if((mf2.fna[ic]>=65 && mf2.fna[ic]<=90) ||
(mf2.fna[ic]>=97 && mf2.fna[ic]<=122) || mf2.fna[ic]==' ' ||
mf2.fna[ic]==13 || mf2.fna[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf2.fna[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf2.fna[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf2.fna[ic]='0';
gotoxy(44,15); //department
// gets(mf2.d);
ic=-1; //department
while(mf2.d[ic]!=13)
{
ic++;
mf2.d[ic]=getch();
cprintf("%c",mf2.d[ic]);
if((mf2.d[ic]>=65 && mf2.d[ic]<=90) ||
(mf2.d[ic]>=97 && mf2.d[ic]<=122) || mf2.d[ic]==' ' || mf2.d[ic]==13 ||
mf2.d[ic]==8)
24 | P a g e
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf2.d[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf2.d[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf2.d[ic]='0';
gotoxy(38,17); //city
// gets(mf2.ci);
ic=-1; //city
while(mf2.ci[ic]!=13)
{
ic++;
mf2.ci[ic]=getch();
cprintf("%c",mf2.ci[ic]);
if((mf2.ci[ic]>=65 && mf2.ci[ic]<=90) ||
(mf2.ci[ic]>=97 && mf2.ci[ic]<=122) || mf2.ci[ic]==' ' || mf2.ci[ic]==13 ||
mf2.ci[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf2.ci[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
25 | P a g e
if(mf2.ci[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
}
mf2.ci[ic]='0';
gotoxy(43,19); //phone no.
// gets(mf2.ph);
ic=-1; //phone no.
while(mf2.ph[ic]!=13)
{
ic++;
mf2.ph[ic]=getch();
cprintf("%c",mf2.ph[ic]);
if((mf2.ph[ic]>=48 && mf2.ph[ic]<=57) ||
mf2.ph[ic]==' ' || mf2.ph[ic]==13 || mf2.ph[ic]==8)
{
}
else
{
cout<<"b b";
ic-=1;
}
if(mf2.ph[ic]==8 && ic>=1)
{
cout<<" b b";
ic-=2;
}
if(mf2.ph[ic]==8 && ic==0)
{
cout<<" ";
ic-=1;
}
if(ic==9)
{
ic++;
char c;
bk3:
c=getch();
if(c==13)
{
26 | P a g e
break;
}
else
{
goto bk3;
}
}
}
mf2.ph[ic]='0';
textcolor(4);
gotoxy(43,21);
cprintf("S");
gotoxy(52,21);
cprintf("C");
textcolor(7);
gotoxy(44,21);
cprintf("ave");
gotoxy(53,21);
cprintf("ancel");
char o;
bk1:
o=getch();
if(o=='s' || o=='S')
{
goto en1;
}
else if(o=='c' || o=='C')
{
return;
}
else
{
goto bk1;
}
en1:
while(of.read((char *) &mf, sizeof mf))
{
if(strcmp(mf.id,tid)==0)
{
// gotoxy(40,7);
27 | P a g e
// cprintf("Data deleted");
tf.write((char *) &mf2, sizeof mf2);
c=1;
}
else
{
tf.write((char *) &mf, sizeof mf);
}
}
tf.close();
of.close();
remove("detail.dat");
rename("temp.dat","detail.dat");
if(c==0)
{
gotoxy(25,22);
cprintf("Data not Found");
}
}
}
void menu_main()
{
textcolor(4);
gotoxy(2,5);
cprintf("A");
gotoxy(2,8);
cprintf("S");
gotoxy(2,11);
cprintf("D");
gotoxy(2,14);
cprintf("M");
gotoxy(2,17);
cprintf("V");
gotoxy(2,20);
cprintf("E");
gotoxy(2,23);
cprintf("B");
textcolor(0);
gotoxy(40,1);
cprintf("Name List Generator");
gotoxy(3,5);
cprintf("dd Student");
28 | P a g e
gotoxy(3,8);
cprintf("earch Student");
gotoxy(3,11);
cprintf("elete Student");
gotoxy(3,14);
cprintf("odify Student");
gotoxy(3,17);
cprintf("iew Student");
gotoxy(3,20);
cprintf("xit");
gotoxy(3,23);
cprintf("ackup");
for(int i=1;i<=25;i++)
{
gotoxy(17,i);
cprintf("%c",179);
}
gotoxy(45,8);
cprintf("Welcome");
gotoxy(38,10);
cprintf("In Name List Generator");
gotoxy(34,12);
cprintf("Created by : Bhanu pratap singh");
gotoxy(40,14);
cprintf("From : BCA 2 year");
textcolor(7);
}
};
}
29 | P a g e
THANK YOU

Bhanu Pratap Singh Shekhawat, BCA Third Year

  • 1.
    SUBMITED BY Bhanu PratapSingh Shekhawat Bachelor of Computer Application II YEAR Dezyne E’cole College www.dezyneecolecollege INFORMATION TECHNOLOGY PROJECT REPORT C++ PROGRAMMING NAME LIST GENERATOR TOPIC C++
  • 2.
    Project Report On C++ Programming At DezyneE’cole College Ajmer Submitted to Dezyne E’cole College Towards the Partial Fulfillment on Bachelor of Computer Application By Bhanu Pratap Singh Shekhawat Dezyne E’cole College 106/10 Civil Line, Ajmer Tel – 0145-2624679 Www.dezyneecole.com 2016
  • 3.
    Acknowledgement I Bhanu PratapSingh Shekhawat, Student On Dezyne E’cole College, An Extremely Grateful To Each And Every Individual. Who Has Contributed. In Successful Completion Of My Project. I Express My Gratitude Towards Dezyne E’cole College For Their. Guidance and Contrast Supervision As Well As For Providing The Necessary Information And Support Regarding The Completion Of Project Thank You
  • 4.
    Synopsis This Project IsA Minor. Project Made, Based On The Practical Concept Of C++ This Project Has Made Our Basic Practical Concepts On C++ Strong
  • 5.
    1 | Pa g e Name List Generator
  • 6.
    2 | Pa g e
  • 7.
    3 | Pa g e
  • 8.
    4 | Pa g e
  • 9.
    5 | Pa g e
  • 10.
    6 | Pa g e
  • 11.
    7 | Pa g e
  • 12.
    8 | Pa g e #include<iostream.h> #include<conio.h> #include<fstream.h> #include<string.h> #include<dos.h> #include<stdlib.h> #include<stdio.h> class student { public: char id[60]; char na[60]; char fna[60]; char d[60]; char ci[60]; char ph[60]; }; class admin { public: char id[60]; char pass[60]; }; fstream of,tf,bf; student mf,mf2; admin af,af1; void main() { class use { public: char tid[60]; void checkid() { int count=0; of.open("detail.dat",ios::in); if(of.fail()) { remove("tid.dat"); } else { while(of.read((char *) &mf, sizeof mf))
  • 13.
    9 | Pa g e { if(of==0) { break; } count++; } } of.close(); if(count==0) { remove("tid.dat"); remove("detail.dat"); remove("backup.dat"); } } void add_menu() { textcolor(7); gotoxy(38,5); cprintf("Enter Student detail"); gotoxy(30,8); cprintf("Id ::"); gotoxy(30,10); cprintf("Name ::"); gotoxy(30,12); cprintf("Father name ::"); gotoxy(30,14); cprintf("Department ::"); gotoxy(30,16); cprintf("City ::"); gotoxy(30,18); cprintf("Phone no. ::"); textcolor(4); gotoxy(43,21); cprintf("S"); gotoxy(50,21); cprintf("C"); textcolor(7); gotoxy(44,21); cprintf("ave"); gotoxy(51,21);
  • 14.
    10 | Pa g e cprintf("ancel"); } void add_student() { textcolor(7); /* clrscr(); white(); menu_main(); window(); add_menu(); */ int id2; of.open("tid.dat",ios::in); tf.open("detail.dat",ios::in); if(of.fail()) { if(tf.fail()) { id2=1; gotoxy(36,8); //id cprintf("%d",id2); } else { while(tf.read((char *) &mf, sizeof mf)) { } id2=0; //convert char to int for(int j=0;mf.id[j]!='0';j++) { id2=id2*10+(mf.id[j]-48); } id2++; } } else { of>>tid; id2=0; //convert char to int for(int j=0;tid[j]!='0';j++) {
  • 15.
    11 | Pa g e id2=id2*10+(tid[j]-48); } id2++; } tf.close(); of.close(); gotoxy(36,8); //id cprintf("%d",id2); int m,t,t1,i,co=0; //convert int to char t=t1=id2; while(t1>0) { co++; t1=t1/10; } i=co-1; while(t>0) { m=t%10; tid[i]=m+48; i--; t=t/10; } tid[co]='0'; gotoxy(36,8); //id cprintf("%s",tid); strcpy(mf.id,tid); gotoxy(38,10); //name // gets(mf.na); //name int ic=-1; //name while(mf.na[ic]!=13) { ic++; mf.na[ic]=getch(); cprintf("%c",mf.na[ic]); if((mf.na[ic]>=65 && mf.na[ic]<=90) || (mf.na[ic]>=97 && mf.na[ic]<=122) || mf.na[ic]==' ' || mf.na[ic]==13 || mf.na[ic]==8) { } else {
  • 16.
    12 | Pa g e cout<<"b b"; ic-=1; } if(mf.na[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf.na[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf.na[ic]='0'; gotoxy(45,12); //father name // gets(mf.fna); ic=-1; //father name while(mf.fna[ic]!=13) { ic++; mf.fna[ic]=getch(); cprintf("%c",mf.fna[ic]); if((mf.fna[ic]>=65 && mf.fna[ic]<=90) || (mf.fna[ic]>=97 && mf.fna[ic]<=122) || mf.fna[ic]==' ' || mf.fna[ic]==13 || mf.fna[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf.fna[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf.fna[ic]==8 && ic==0) { cout<<" "; ic-=1;
  • 17.
    13 | Pa g e } } mf.fna[ic]='0'; gotoxy(44,14); //department // gets(mf.d); ic=-1; //department while(mf.d[ic]!=13) { ic++; mf.d[ic]=getch(); cprintf("%c",mf.d[ic]); if((mf.d[ic]>=65 && mf.d[ic]<=90) || (mf.d[ic]>=97 && mf.d[ic]<=122) || mf.d[ic]==' ' || mf.d[ic]==13 || mf.d[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf.d[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf.d[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf.d[ic]='0'; gotoxy(38,16); //city // gets(mf.ci); ic=-1; //city while(mf.ci[ic]!=13) { ic++; mf.ci[ic]=getch(); cprintf("%c",mf.ci[ic]);
  • 18.
    14 | Pa g e if((mf.ci[ic]>=65 && mf.ci[ic]<=90) || (mf.ci[ic]>=97 && mf.ci[ic]<=122) || mf.ci[ic]==' ' || mf.ci[ic]==13 || mf.ci[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf.ci[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf.ci[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf.ci[ic]='0'; gotoxy(43,18); //phone no. // gets(mf.ph); ic=-1; //phone no. while(mf.ph[ic]!=13) { ic++; mf.ph[ic]=getch(); cprintf("%c",mf.ph[ic]); if((mf.ph[ic]>=48 && mf.ph[ic]<=57) || mf.ph[ic]==' ' || mf.ph[ic]==13 || mf.ph[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf.ph[ic]==8 && ic>=1) { cout<<" b b"; ic-=2;
  • 19.
    15 | Pa g e } if(mf.ph[ic]==8 && ic==0) { cout<<" "; ic-=1; } if(ic==9) { ic++; char c; bk: c=getch(); if(c==13) { break; } else { goto bk; } } } mf.ph[ic]='0'; gotoxy(43,21); } void save() { of.open("detail.dat",ios::out | ios::app); of.write((char *) &mf, sizeof mf); of.close(); of.open("tid.dat",ios::out); of<<tid; of.close(); } void out() { outprint(); int i=7; of.open("detail.dat",ios::in); if(of.fail()) { gotoxy(30,i); cprintf("Record not available");
  • 20.
    16 | Pa g e } else { while(of.read((char *) &mf, sizeof mf)) { gotoxy(25,i); cprintf("%s",mf.id); gotoxy(34,i); cprintf("%s",mf.na); i++; if(i==22) { getch(); i=7; window(); outprint(); } } } of.close(); } void outprint() { textcolor(7); gotoxy(25,5); cprintf("Id"); gotoxy(34,5); cprintf("Name"); for(int i=5;i<=23;i++) { for(int j=22;j<=75;j++) { if(j==29) { gotoxy(j,i); cprintf("%c",179); } } } } void search_student() { textcolor(7);
  • 21.
    17 | Pa g e gotoxy(25,5); cprintf("Enter Id :::: "); gets(tid); int c=0; of.open("detail.dat",ios::in); if(of.fail()) { gotoxy(25,7); cprintf("File not available"); } else { while(of.read((char *) &mf, sizeof mf)) { if(strcmp(mf.id,tid)==0) { window(); gotoxy(38,7); cprintf("Student detail"); gotoxy(30,9); cprintf("Id ::"); gotoxy(30,11); cprintf("Name ::"); gotoxy(30,13); cprintf("Father name ::"); gotoxy(30,15); cprintf("Department ::"); gotoxy(30,17); cprintf("City ::"); gotoxy(30,19); cprintf("Phone no. ::"); gotoxy(36,9); //id cprintf("%s",mf.id); gotoxy(38,11); //name cprintf("%s",mf.na); gotoxy(45,13); //father name cprintf("%s",mf.fna); gotoxy(44,15); //department cprintf("%s",mf.d); gotoxy(38,17); //city cprintf("%s",mf.ci); gotoxy(43,19); //phone no. cprintf("%s",mf.ph);
  • 22.
    18 | Pa g e c=1; } } of.close(); if(c==0) { gotoxy(25,7); cprintf("Id not available"); } } } void delete_student() { textcolor(7); gotoxy(25,5); cprintf("Enter Id you want to delete :::: "); gets(tid); textcolor(4); gotoxy(42,21); cprintf("D"); gotoxy(51,21); cprintf("C"); textcolor(7); gotoxy(43,21); cprintf("elete"); gotoxy(52,21); cprintf("ancel"); char o; bk: o=getch(); if(o=='d' || o=='D') { goto en; } else if(o=='c' || o=='C') { return; } else { goto bk;
  • 23.
    19 | Pa g e } en: int c=0; of.open("detail.dat",ios::in); tf.open("temp.dat",ios::out | ios::app); bf.open("backup.dat",ios::out | ios::app); if(of.fail()) { gotoxy(25,7); cprintf("File not available"); } else { while(of.read((char *) &mf, sizeof mf)) { if(strcmp(mf.id,tid)==0) { gotoxy(40,7); cprintf("Data deleted"); gotoxy(30,9); cprintf("Id ::"); gotoxy(30,11); cprintf("Name ::"); gotoxy(30,13); cprintf("Father name ::"); gotoxy(30,15); cprintf("Department ::"); gotoxy(30,17); cprintf("City ::"); gotoxy(30,19); cprintf("Phone no. ::"); gotoxy(36,9); //id cprintf("%s",mf.id); gotoxy(38,11); //name cprintf("%s",mf.na); gotoxy(45,13); //father name cprintf("%s",mf.fna); gotoxy(44,15); //department cprintf("%s",mf.d); gotoxy(38,17); //city cprintf("%s",mf.ci); gotoxy(43,19); //phone no. cprintf("%s",mf.ph);
  • 24.
    20 | Pa g e c=1; bf.write((char *) &mf, sizeof mf); } else { tf.write((char *) &mf, sizeof mf); } } bf.close(); tf.close(); of.close(); remove("detail.dat"); rename("temp.dat","detail.dat"); if(c==0) { gotoxy(25,22); cprintf("Data not Found"); } } } void modify_student() { textcolor(7); gotoxy(25,5); cprintf("Enter Id you want to Modify :::: "); gets(tid); gotoxy(30,7); cprintf("You want to modify data to select option"); textcolor(4); gotoxy(42,21); cprintf("M"); gotoxy(51,21); cprintf("C"); textcolor(7); gotoxy(43,21); cprintf("odify"); gotoxy(52,21); cprintf("ancel"); char o; bk: o=getch(); if(o=='m' || o=='M') {
  • 25.
    21 | Pa g e goto en; } else if(o=='c' || o=='C') { return; } else { goto bk; } en: window(); int c=0,ch=0; of.open("detail.dat",ios::in); if(of.fail()) { gotoxy(25,9); cprintf("File not available"); } else { while(of.read((char *) &mf, sizeof mf)) { if(strcmp(tid,mf.id)==0) { ch=1; } } of.close(); if(ch==0) { gotoxy(25,9); cprintf("Record not available"); getch(); return; } of.open("detail.dat",ios::in); tf.open("temp.dat",ios::out | ios::app); gotoxy(38,7); cprintf("Enter new detail"); gotoxy(30,9); cprintf("Id ::");
  • 26.
    22 | Pa g e gotoxy(30,11); cprintf("Name ::"); gotoxy(30,13); cprintf("Father name ::"); gotoxy(30,15); cprintf("Department ::"); gotoxy(30,17); cprintf("City ::"); gotoxy(30,19); cprintf("Phone no. ::"); gotoxy(36,9); //id strcpy(mf2.id,tid); cprintf("%s",mf2.id); gotoxy(38,11); //name // gets(mf2.na); int ic=-1; //name while(mf2.na[ic]!=13) { ic++; mf2.na[ic]=getch(); cprintf("%c",mf2.na[ic]); if((mf2.na[ic]>=65 && mf2.na[ic]<=90) || (mf2.na[ic]>=97 && mf2.na[ic]<=122) || mf2.na[ic]==' ' || mf2.na[ic]==13 || mf2.na[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf2.na[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf2.na[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf2.na[ic]='0';
  • 27.
    23 | Pa g e gotoxy(45,13); //father name // gets(mf2.fna); ic=-1; //father name while(mf2.fna[ic]!=13) { ic++; mf2.fna[ic]=getch(); cprintf("%c",mf2.fna[ic]); if((mf2.fna[ic]>=65 && mf2.fna[ic]<=90) || (mf2.fna[ic]>=97 && mf2.fna[ic]<=122) || mf2.fna[ic]==' ' || mf2.fna[ic]==13 || mf2.fna[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf2.fna[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf2.fna[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf2.fna[ic]='0'; gotoxy(44,15); //department // gets(mf2.d); ic=-1; //department while(mf2.d[ic]!=13) { ic++; mf2.d[ic]=getch(); cprintf("%c",mf2.d[ic]); if((mf2.d[ic]>=65 && mf2.d[ic]<=90) || (mf2.d[ic]>=97 && mf2.d[ic]<=122) || mf2.d[ic]==' ' || mf2.d[ic]==13 || mf2.d[ic]==8)
  • 28.
    24 | Pa g e { } else { cout<<"b b"; ic-=1; } if(mf2.d[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf2.d[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf2.d[ic]='0'; gotoxy(38,17); //city // gets(mf2.ci); ic=-1; //city while(mf2.ci[ic]!=13) { ic++; mf2.ci[ic]=getch(); cprintf("%c",mf2.ci[ic]); if((mf2.ci[ic]>=65 && mf2.ci[ic]<=90) || (mf2.ci[ic]>=97 && mf2.ci[ic]<=122) || mf2.ci[ic]==' ' || mf2.ci[ic]==13 || mf2.ci[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf2.ci[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; }
  • 29.
    25 | Pa g e if(mf2.ci[ic]==8 && ic==0) { cout<<" "; ic-=1; } } mf2.ci[ic]='0'; gotoxy(43,19); //phone no. // gets(mf2.ph); ic=-1; //phone no. while(mf2.ph[ic]!=13) { ic++; mf2.ph[ic]=getch(); cprintf("%c",mf2.ph[ic]); if((mf2.ph[ic]>=48 && mf2.ph[ic]<=57) || mf2.ph[ic]==' ' || mf2.ph[ic]==13 || mf2.ph[ic]==8) { } else { cout<<"b b"; ic-=1; } if(mf2.ph[ic]==8 && ic>=1) { cout<<" b b"; ic-=2; } if(mf2.ph[ic]==8 && ic==0) { cout<<" "; ic-=1; } if(ic==9) { ic++; char c; bk3: c=getch(); if(c==13) {
  • 30.
    26 | Pa g e break; } else { goto bk3; } } } mf2.ph[ic]='0'; textcolor(4); gotoxy(43,21); cprintf("S"); gotoxy(52,21); cprintf("C"); textcolor(7); gotoxy(44,21); cprintf("ave"); gotoxy(53,21); cprintf("ancel"); char o; bk1: o=getch(); if(o=='s' || o=='S') { goto en1; } else if(o=='c' || o=='C') { return; } else { goto bk1; } en1: while(of.read((char *) &mf, sizeof mf)) { if(strcmp(mf.id,tid)==0) { // gotoxy(40,7);
  • 31.
    27 | Pa g e // cprintf("Data deleted"); tf.write((char *) &mf2, sizeof mf2); c=1; } else { tf.write((char *) &mf, sizeof mf); } } tf.close(); of.close(); remove("detail.dat"); rename("temp.dat","detail.dat"); if(c==0) { gotoxy(25,22); cprintf("Data not Found"); } } } void menu_main() { textcolor(4); gotoxy(2,5); cprintf("A"); gotoxy(2,8); cprintf("S"); gotoxy(2,11); cprintf("D"); gotoxy(2,14); cprintf("M"); gotoxy(2,17); cprintf("V"); gotoxy(2,20); cprintf("E"); gotoxy(2,23); cprintf("B"); textcolor(0); gotoxy(40,1); cprintf("Name List Generator"); gotoxy(3,5); cprintf("dd Student");
  • 32.
    28 | Pa g e gotoxy(3,8); cprintf("earch Student"); gotoxy(3,11); cprintf("elete Student"); gotoxy(3,14); cprintf("odify Student"); gotoxy(3,17); cprintf("iew Student"); gotoxy(3,20); cprintf("xit"); gotoxy(3,23); cprintf("ackup"); for(int i=1;i<=25;i++) { gotoxy(17,i); cprintf("%c",179); } gotoxy(45,8); cprintf("Welcome"); gotoxy(38,10); cprintf("In Name List Generator"); gotoxy(34,12); cprintf("Created by : Bhanu pratap singh"); gotoxy(40,14); cprintf("From : BCA 2 year"); textcolor(7); } }; }
  • 33.
    29 | Pa g e THANK YOU