PROJECT REPORT
C++
INFORMATION TECHNOLOGY
TOPIC
Name List Generator
SUBMITTED BY
RAHUL SAINI
BCA IInd
YEAR
Dezyne E’cole College
www.dezyneecole.com
PROJECT REPORT
On
C++ programming
At
Dezyne E’cole College
Ajmer
Submitted
Dezyne E’cole College
Towards the
Partial fulfillment
Bachelor of computer application
By
Rahul Saini
Dezyne E’cole College
106/10, civil line, Ajmer
Tel-0145-2624679
www.dezyneecole.com
2016-2017
ACKNOWLEDGEMENT
I Rahul Saini Student Of Dezyne’ Ecole College
And Extremly Grateful To Each And Every
Individual Who Has Contribute In Sucessfull
Completion Of My Project I Express My Graditude
Towords Dezyne Ecole College For Their
Kindness.And Constant Supervision As Well As
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 concept on C++ strong.
1
NAME LIST GENERATOR
OUTPUT->
MAIN INTERFACE->
2
Add Student Detail->
3
View Student Detail->
4
Search Student Detail->
5
Delete student detail->
6
Source code
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<stdlib.h>
#include<string.h>
class file
{
public:
int id;
char fn[10],mn[10],ci[8],d[20],n[10],cl[10];
void get()
{
cout<<"tt"<<"Add Student Detail"<<endl;
cout<<"id"<<"t"<<"name"<<"t"<<"fname"<<"t"<<"mname"<<"t"<<"class"<<
"t"<<"city"<<"t"<<"dob"<<endl;
gotoxy(1,3);
cin>>id;
gotoxy(9,3);
cin>>n;
gotoxy(17,3);
cin>>fn;
gotoxy(25,3);
cin>>mn;
gotoxy(33,3);
cin>>cl;
gotoxy(41,3);
cin>>ci;
gotoxy(49,3);
cin>>d;
}
7
void store(file x)
{
fstream fp;
fp.open("student3.txt",ios::app);
fp.write((char *)&x,sizeof(x));
cout<<"data store...";
fp.close();
}
void show()
{
cout<<"tt"<<"View Student Detail"<<endl;
file x;
fstream fp;
fp.open("student3.txt",ios::in);
while(fp.read((char *)&x,sizeof(x)));
{
cout<<"id"<<"t"<<"name"<<"t"<<"fname"<<"t"<<"mname"
<<"t"<<"class"<<"t"<<"city"<<"t"<<"dob"<<endl;
cout<<x.id<<"t"<<x.n<<"t"<<x.fn<<"t"<<x.mn<<"t"
<<x.cl<<"t"<<x.ci<<"t"<<x.d<<endl;
}
}
void search()
{
cout<<"tt"<<"Search Student Detail"<<endl;
file x;
int i;
int c=0;
fstream fp;
cout<<"Enter id===";
cin>>i;
fp.open("student3.txt",ios::in);
8
cout<<"tt"<<"Search Student Detail"<<endl;
file x;
int i;
int c=0;
fstream fp;
cout<<"Enter id===";
cin>>i;
fp.open("student3.txt",ios::in);
while(fp.read((char*)&x,sizeof(x)))
{
if(i==x.id)
{
cout<<x.id<<"t"<<x.n<<"t"<<x.fn<<"t"<<x.mn<<"t"<<x.cl
<<"t"<<x.ci<<"t"<<x.d<<endl;
c++;
}
}
if(c==0)
{
cout<<"Data not found";
}
}
void dele()
{
cout<<"tt"<<"Delete Student Detail"<<endl;
file x;
int i;
int c=0;
fstream fp;
fstream fp1;
cout<<"Enter id===";
cin>>i;
9
fp.open("student3.txt",ios::in);
fp1.open("temp1.txt",ios::out);
while(fp.read((char *)&x,sizeof(x)))
{
if(i==x.id)
{
cout<<"Recorded is delete..";
c++;
}
else
{
fp.write((char *)&x,sizeof(x));
}
}
if(c==0)
{
cout<<"Data not found for delete";
}
fp1.close();
fp.close();
remove("student3.txt");
rename("temp1.txt","student3.txt");
}
};
void main()
{
clrscr();
file w,y,r,s;
int i;
char c;
textcolor(20);
gotoxy(2,2);
10
cout<<"Welcome To Name List Generator->";
gotoxy(32,4);
cprintf("A");
cout<<"dd Student";
gotoxy(32,5);
cprintf("V");
cout<<"iew Student";
gotoxy(32,6);
cprintf("S");
cout<<"earch Student";
gotoxy(32,7);
cprintf("D");
cout<<"elete Student";
gotoxy(32,8);
cprintf("E");
cout<<"xit";
gotoxy(34,10);
cout<<"Enter Your Choice===";
c=getch();
if(c=='A'|| c=='a')
{
clrscr();
w.get();
w.store(w);
getch();
main();
}
11
else if(c=='V'||c=='v')
{
clrscr();
r.show();
getch();
main();
}
else if(c=='S'||c=='s')
{
clrscr();
s.search();
getch();
main();
}
else if(c=='D'||c=='d')
{
clrscr();
y.dele();
getch();
main();
}
else if(c=='E'||c=='e')
{
exit(0);
}
else
{
main();
}
12
ofstream abc("student3.txt");
abc<<y.id<<"t";
abc<<y.n<<"t";
abc<<y.fn<<"t";
abc<<y.mn<<"t";
abc<<y.cl<<"t";
abc<<y.ci<<"t";
abc<<y.d<<"n";
abc.close();
ifstream abcw("student3.txt");
abcw>>y.id>>y.n>>y.fn>>y.mn>>y.cl>>y.ci>>y.d;
abcw.close();
getch();
}
13
THANK YOU

BCA 2nd year C++ File