Information Technology
Topic: - Name List Generator
Submitted By
Rounit Mathur
BCA II year
C++
www.dezyneecole.com
Partial Fulfillment
On
C++
At
Dezyne E’cole College
Submitted to
Dezyne E’cole College
Partial Fulfillment on
BCA
Bachelors of Computer Application
By
Rounit Mathur
Dezyne E’cole College
106/10, Civil Lines Ajmer
Tel-Phone - 0145-2624679
www.dezyneecole.com
2016-2017
Acknowledgement
I ROUNIT MATHUR STUDENT OF 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 TO THEIR GUIDELINES AND CONSTANT
SUPERVISION AS WELL FOR PROVIDING THE NECESSARY
INFORMATION AND SUPPORT REGARDING THE COMPLETION
OF PROJECT.
Thank you
Synopsis
THIS PROJECT IS A MINOR PROJECT MADE BASED ON
PRACTICAL CONCEPTS OF C++. THIS PROJECT HAS MADE
OUR BASIC PRACTICAL CONCEPTS ON C++ STRONG.
P a g e | 1
Name List Generator
Coding:-
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<fstream.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
class var
{
public:
char n[20],c[20],l[20];
char id[20];
P a g e | 2
};
var w,in;
fstream u;
fstream f;
void main()
{
class file
{
public:
void bor()
{
int i;
for(i=2;i<79;i++)
{
gotoxy(i,3);
cout<<"-";
gotoxy(i,4);
cout<<"-";
gotoxy(i,22);
cout<<"-";
gotoxy(i,23);
cout<<"-";
}
for(i=2;i<=24;i++)
{
gotoxy(5,i);
cout<<"|";
gotoxy(6,i);
cout<<"-";
gotoxy(7,i);
cout<<"|";
gotoxy(74,i);
P a g e | 3
cout<<"|";
gotoxy(75,i);
cout<<"-";
gotoxy(76,i);
cout<<"|";
}
}
void con()
{
char c;
gotoxy(20,20);
textcolor(4);
cprintf("C");
textcolor(7);
cout<<"ontinue";
gotoxy(39,20);
textcolor(4);
cprintf("B");
cout<<"ack";
gotoxy(55,20);
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
c=getch();
switch(c)
{
case 'c':
case 'C':
clrscr();
get();
case 'b':
P a g e | 4
case 'B':
clrscr();
main();
case 'E':
case 'e':
exit(0);
}
}
void op()
{
bor();
char c;
gotoxy(30,6);
cout<<"NAME LIST GENERATOR";
textcolor(4);
gotoxy(22,10);
cprintf("I");
textcolor(7);
cout<<"nsert Student";
gotoxy(44,10);
textcolor(4);
cprintf("V");
textcolor(7);
cout<<"iew Student";
gotoxy(22,12);
textcolor(4);
cprintf("D");
textcolor(7);
cout<<"elete Student";
gotoxy(44,12);
textcolor(4);
P a g e | 5
cprintf("M");
textcolor(7);
cout<<"odify Student";
gotoxy(22,14);
textcolor(4);
cprintf("S");
textcolor(7);
cout<<"earch Student";
gotoxy(44,14);
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
c=getch();
switch(c)
{
case 'i' :
case 'I' :
clrscr();
get();
break;
case 'v':
case 'V':
clrscr();
view();
break;
case 'd':
case 'D':
clrscr();
del();
break;
case 'm':
P a g e | 6
case 'M' :
clrscr();
mod();
break;
case 's':
case 'S' :
clrscr();
search();
break;
case 'e':
case 'E':
exit(0);
default: cout<<"Wrong Input";
main();
break;
}
}
P a g e | 7
Insert Student Detail
View Inserted Record
P a g e | 8
Coding:-
void get()
{
clrscr();
bor();
gotoxy(25,6);
cout<<"INSERT Student Details";
gotoxy(20,8);
cout<<"Enter Id::";
cin>>in.id;
f.open("std",ios::in);
while(f.read((char *) &w,sizeof(w)))
{
if(strcmp(w.id,in.id)==0)
{
get();
}
if(f==0)
{
break;
}
}
f.close();
gotoxy(20,10);
cout<<"Enter Name::";
gets(in.n) ;
gotoxy(20,12);
cout<<"Enter Class::";
gets(in.l);
gotoxy(20,14);
cout<<"Enter City::";
P a g e | 9
gets(in.c);
add();
con();
}
void add()
{
f.open("std",ios::out | ios::app);
f.write((char *) &in,sizeof(in));
f.close();
gotoxy(27,16);
cout<<"Record INSERTED";
}
P a g e | 10
View all Records
Coding:-
void view()
{
bor();
gotoxy(30,6);
cout<<"VIEW all Records";
gotoxy(20,8);
cout<<"Id"<<"t"<<"Name"<<"tt"<<"Class"<<"t"<<"City"<<endl;
f.open("std",ios::in);
gotoxy(20,9);
while(f.read((char *) &in,sizeof(in)))
{
cout<<in.id<<"t"<<in.n<<"t"<<in.l<<"t"<<in.c<<endl<<"tt ";
if(f==0)
{
break;
P a g e | 11
}
}
f.close();
char c;
gotoxy(20,20);
textcolor(4);
cprintf("B");
cout<<"ack";
gotoxy(55,20);
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
bor();
c=getch();
switch(c)
{
case 'b':
case 'B':
clrscr();
main();
case 'E':
case 'e':
exit(0);
}
}
P a g e | 12
Modify Student Detail
Before Modify
P a g e | 13
After Modify
Coding:-
void mod()
{
char aid[5];
bor();
gotoxy(25,6);
cout<<"MODIFY Student Detail";
gotoxy(25,8);
cout<<"Enter id::";
cin>>aid;
f.open("std",ios::in);
u.open("temp",ios::app);
while(f.read((char *) &in,sizeof(in)))
{
if(strcmp(in.id,aid)==0)
{
P a g e | 14
strcpy(in.id,aid);
gotoxy(25,10);
cout<<"Name::";
gets(in.n);
gotoxy(25,12);
cout<<"Class::";
gets(in.l);
gotoxy(25,14);
cout<<"City::";
gets(in.c);
u.write((char *) &in,sizeof(in));
gotoxy(24,16);
cout<<"Data Modified";
}
else
{
u.write((char *) &in,sizeof(in));
}
}
u.close();
f.close();
remove("std");
rename("temp","std");
char c;
gotoxy(20,20);
textcolor(4);
cprintf("C");
textcolor(7);
cout<<"ontinue";
gotoxy(39,20);
textcolor(4);
cprintf("B");
cout<<"ack";
gotoxy(55,20);
P a g e | 15
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
c=getch();
switch(c)
{
case 'c':
case 'C':
clrscr();
mod();
case 'b':
case 'B':
clrscr();
main();
case 'E':
case 'e':
exit(0);
}
}
P a g e | 16
Delete Student Detail
Before Delete
P a g e | 17
After Deleted
Coding:-
void del()
{
bor();
char id[5];
gotoxy(25,6);
cout<<"DELETE Student Detail";
gotoxy(25,8);
cout<<"Enter id::";
cin>>id;
f.open("std",ios::in);
u.open("temp",ios::out);
while(f.read((char *) &in,sizeof(in)))
{
if(strcmp(in.id,id)==0)
P a g e | 18
{
gotoxy(27,10);
cout<<"Name::"<<in.n;
gotoxy(27,11);
cout<<"Class::"<<in.l;
gotoxy(27,12);
cout<<"City::"<<in.c;
gotoxy(30,15);
cout<<"Record DELETED";
}
else
{
u.write((char *) &in,sizeof(in));
}
}
u.close();
f.close();
remove("std");
rename("temp","std");
char c;
gotoxy(20,20);
textcolor(4);
cprintf("C");
textcolor(7);
cout<<"ontinue";
gotoxy(39,20);
textcolor(4);
cprintf("B");
cout<<"ack";
gotoxy(55,20);
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
P a g e | 19
c=getch();
switch(c)
{
case 'c':
case 'C':
clrscr();
del();
case 'b':
case 'B':
clrscr();
main();
case 'E':
case 'e':
exit(0);
}
}
P a g e | 20
Search Student
View Search Record
P a g e | 21
Coding:-
void search()
{
bor();
gotoxy(25,6);
cout<<"SEARCH Student Details";
gotoxy(25,8);
cout<<"Enter id::";
cin>>w.id;
int c=0;
f.open("std",ios::in);
while(f.read((char *) &in,sizeof(in)))
{
if(strcmp(w.id,in.id)==0)
{
gotoxy(27,11);
cout<<"Name::"<<in.n;
gotoxy(27,13);
cout<<"Class::"<<in.l;
gotoxy(27,15);
cout<<"City::"<<in.c;
c=1;
}
}
if(c==0)
{
gotoxy(27,15);
cout<<"Data NOT found";
}
char c1;
gotoxy(20,20);
textcolor(4);
cprintf("C");
P a g e | 22
textcolor(7);
cout<<"ontinue";
gotoxy(39,20);
textcolor(4);
cprintf("B");
cout<<"ack";
gotoxy(55,20);
textcolor(4);
cprintf("E");
textcolor(7);
cout<<"xit";
c1=getch();
switch(c1)
{
case 'c':
case 'C':
clrscr();
search();
case 'b':
case 'B':
clrscr();
main();
case 'E':
case 'e':
exit(0);
}
}
};
clrscr();
file o;
o.op();
getch();
}
P a g e | 23
Thank you

Rounit Mathur , BCA Third Year

  • 1.
    Information Technology Topic: -Name List Generator Submitted By Rounit Mathur BCA II year C++ www.dezyneecole.com
  • 2.
    Partial Fulfillment On C++ At Dezyne E’coleCollege Submitted to Dezyne E’cole College Partial Fulfillment on BCA Bachelors of Computer Application By Rounit Mathur Dezyne E’cole College 106/10, Civil Lines Ajmer Tel-Phone - 0145-2624679 www.dezyneecole.com 2016-2017
  • 3.
    Acknowledgement I ROUNIT MATHURSTUDENT OF 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 TO THEIR GUIDELINES AND CONSTANT SUPERVISION AS WELL FOR PROVIDING THE NECESSARY INFORMATION AND SUPPORT REGARDING THE COMPLETION OF PROJECT. Thank you
  • 4.
    Synopsis THIS PROJECT ISA MINOR PROJECT MADE BASED ON PRACTICAL CONCEPTS OF C++. THIS PROJECT HAS MADE OUR BASIC PRACTICAL CONCEPTS ON C++ STRONG.
  • 5.
    P a ge | 1 Name List Generator Coding:- #include<iostream.h> #include<conio.h> #include<iomanip.h> #include<fstream.h> #include<stdio.h> #include<stdlib.h> #include<string.h> class var { public: char n[20],c[20],l[20]; char id[20];
  • 6.
    P a ge | 2 }; var w,in; fstream u; fstream f; void main() { class file { public: void bor() { int i; for(i=2;i<79;i++) { gotoxy(i,3); cout<<"-"; gotoxy(i,4); cout<<"-"; gotoxy(i,22); cout<<"-"; gotoxy(i,23); cout<<"-"; } for(i=2;i<=24;i++) { gotoxy(5,i); cout<<"|"; gotoxy(6,i); cout<<"-"; gotoxy(7,i); cout<<"|"; gotoxy(74,i);
  • 7.
    P a ge | 3 cout<<"|"; gotoxy(75,i); cout<<"-"; gotoxy(76,i); cout<<"|"; } } void con() { char c; gotoxy(20,20); textcolor(4); cprintf("C"); textcolor(7); cout<<"ontinue"; gotoxy(39,20); textcolor(4); cprintf("B"); cout<<"ack"; gotoxy(55,20); textcolor(4); cprintf("E"); textcolor(7); cout<<"xit"; c=getch(); switch(c) { case 'c': case 'C': clrscr(); get(); case 'b':
  • 8.
    P a ge | 4 case 'B': clrscr(); main(); case 'E': case 'e': exit(0); } } void op() { bor(); char c; gotoxy(30,6); cout<<"NAME LIST GENERATOR"; textcolor(4); gotoxy(22,10); cprintf("I"); textcolor(7); cout<<"nsert Student"; gotoxy(44,10); textcolor(4); cprintf("V"); textcolor(7); cout<<"iew Student"; gotoxy(22,12); textcolor(4); cprintf("D"); textcolor(7); cout<<"elete Student"; gotoxy(44,12); textcolor(4);
  • 9.
    P a ge | 5 cprintf("M"); textcolor(7); cout<<"odify Student"; gotoxy(22,14); textcolor(4); cprintf("S"); textcolor(7); cout<<"earch Student"; gotoxy(44,14); textcolor(4); cprintf("E"); textcolor(7); cout<<"xit"; c=getch(); switch(c) { case 'i' : case 'I' : clrscr(); get(); break; case 'v': case 'V': clrscr(); view(); break; case 'd': case 'D': clrscr(); del(); break; case 'm':
  • 10.
    P a ge | 6 case 'M' : clrscr(); mod(); break; case 's': case 'S' : clrscr(); search(); break; case 'e': case 'E': exit(0); default: cout<<"Wrong Input"; main(); break; } }
  • 11.
    P a ge | 7 Insert Student Detail View Inserted Record
  • 12.
    P a ge | 8 Coding:- void get() { clrscr(); bor(); gotoxy(25,6); cout<<"INSERT Student Details"; gotoxy(20,8); cout<<"Enter Id::"; cin>>in.id; f.open("std",ios::in); while(f.read((char *) &w,sizeof(w))) { if(strcmp(w.id,in.id)==0) { get(); } if(f==0) { break; } } f.close(); gotoxy(20,10); cout<<"Enter Name::"; gets(in.n) ; gotoxy(20,12); cout<<"Enter Class::"; gets(in.l); gotoxy(20,14); cout<<"Enter City::";
  • 13.
    P a ge | 9 gets(in.c); add(); con(); } void add() { f.open("std",ios::out | ios::app); f.write((char *) &in,sizeof(in)); f.close(); gotoxy(27,16); cout<<"Record INSERTED"; }
  • 14.
    P a ge | 10 View all Records Coding:- void view() { bor(); gotoxy(30,6); cout<<"VIEW all Records"; gotoxy(20,8); cout<<"Id"<<"t"<<"Name"<<"tt"<<"Class"<<"t"<<"City"<<endl; f.open("std",ios::in); gotoxy(20,9); while(f.read((char *) &in,sizeof(in))) { cout<<in.id<<"t"<<in.n<<"t"<<in.l<<"t"<<in.c<<endl<<"tt "; if(f==0) { break;
  • 15.
    P a ge | 11 } } f.close(); char c; gotoxy(20,20); textcolor(4); cprintf("B"); cout<<"ack"; gotoxy(55,20); textcolor(4); cprintf("E"); textcolor(7); cout<<"xit"; bor(); c=getch(); switch(c) { case 'b': case 'B': clrscr(); main(); case 'E': case 'e': exit(0); } }
  • 16.
    P a ge | 12 Modify Student Detail Before Modify
  • 17.
    P a ge | 13 After Modify Coding:- void mod() { char aid[5]; bor(); gotoxy(25,6); cout<<"MODIFY Student Detail"; gotoxy(25,8); cout<<"Enter id::"; cin>>aid; f.open("std",ios::in); u.open("temp",ios::app); while(f.read((char *) &in,sizeof(in))) { if(strcmp(in.id,aid)==0) {
  • 18.
    P a ge | 14 strcpy(in.id,aid); gotoxy(25,10); cout<<"Name::"; gets(in.n); gotoxy(25,12); cout<<"Class::"; gets(in.l); gotoxy(25,14); cout<<"City::"; gets(in.c); u.write((char *) &in,sizeof(in)); gotoxy(24,16); cout<<"Data Modified"; } else { u.write((char *) &in,sizeof(in)); } } u.close(); f.close(); remove("std"); rename("temp","std"); char c; gotoxy(20,20); textcolor(4); cprintf("C"); textcolor(7); cout<<"ontinue"; gotoxy(39,20); textcolor(4); cprintf("B"); cout<<"ack"; gotoxy(55,20);
  • 19.
    P a ge | 15 textcolor(4); cprintf("E"); textcolor(7); cout<<"xit"; c=getch(); switch(c) { case 'c': case 'C': clrscr(); mod(); case 'b': case 'B': clrscr(); main(); case 'E': case 'e': exit(0); } }
  • 20.
    P a ge | 16 Delete Student Detail Before Delete
  • 21.
    P a ge | 17 After Deleted Coding:- void del() { bor(); char id[5]; gotoxy(25,6); cout<<"DELETE Student Detail"; gotoxy(25,8); cout<<"Enter id::"; cin>>id; f.open("std",ios::in); u.open("temp",ios::out); while(f.read((char *) &in,sizeof(in))) { if(strcmp(in.id,id)==0)
  • 22.
    P a ge | 18 { gotoxy(27,10); cout<<"Name::"<<in.n; gotoxy(27,11); cout<<"Class::"<<in.l; gotoxy(27,12); cout<<"City::"<<in.c; gotoxy(30,15); cout<<"Record DELETED"; } else { u.write((char *) &in,sizeof(in)); } } u.close(); f.close(); remove("std"); rename("temp","std"); char c; gotoxy(20,20); textcolor(4); cprintf("C"); textcolor(7); cout<<"ontinue"; gotoxy(39,20); textcolor(4); cprintf("B"); cout<<"ack"; gotoxy(55,20); textcolor(4); cprintf("E"); textcolor(7); cout<<"xit";
  • 23.
    P a ge | 19 c=getch(); switch(c) { case 'c': case 'C': clrscr(); del(); case 'b': case 'B': clrscr(); main(); case 'E': case 'e': exit(0); } }
  • 24.
    P a ge | 20 Search Student View Search Record
  • 25.
    P a ge | 21 Coding:- void search() { bor(); gotoxy(25,6); cout<<"SEARCH Student Details"; gotoxy(25,8); cout<<"Enter id::"; cin>>w.id; int c=0; f.open("std",ios::in); while(f.read((char *) &in,sizeof(in))) { if(strcmp(w.id,in.id)==0) { gotoxy(27,11); cout<<"Name::"<<in.n; gotoxy(27,13); cout<<"Class::"<<in.l; gotoxy(27,15); cout<<"City::"<<in.c; c=1; } } if(c==0) { gotoxy(27,15); cout<<"Data NOT found"; } char c1; gotoxy(20,20); textcolor(4); cprintf("C");
  • 26.
    P a ge | 22 textcolor(7); cout<<"ontinue"; gotoxy(39,20); textcolor(4); cprintf("B"); cout<<"ack"; gotoxy(55,20); textcolor(4); cprintf("E"); textcolor(7); cout<<"xit"; c1=getch(); switch(c1) { case 'c': case 'C': clrscr(); search(); case 'b': case 'B': clrscr(); main(); case 'E': case 'e': exit(0); } } }; clrscr(); file o; o.op(); getch(); }
  • 27.
    P a ge | 23 Thank you