Student Management Program
Student Management Program
BAIKUNTHPUR.
Computer Science
"Student' s Record management
INVESTIGATORY PROJECT
201718
Prepared by
Prepared under
the guidance of
Principal
(Mr. R.K. KAUSHIK)
Acknowledgement
We would like to thank Mr. R.K. Asnani , Senior Lecturer (Computer
Science) , for his able guidance and the support exhibited by him in the
completion of the project.
Thanking you
Aman Bhagat
Abhay Singh
Rohit Kumar Singh
INTRODUCTION
//=====================================================================================
========================================================
{
private :
int Class,Rollno,Admno,Yoa,Ts;
char
Name[40],Fname[40],Mname[40],Subject[20],Group[20],Email[40],Sex[20],Address[20],Pno[15
],Dob[15];
char User[20]="Ab",Pass[20]="C++";
public :
void Assign();
void Disp();
char * Rname();
char * Rfname();
int Radmno();
int Rclass();
char * Rgroup();
int Rno();
char * Ruser();
char * Rpass();
void gotoxy(int x,int y)
{
COORD coord;
coord.X=x;
coord.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
void Design(char a[1000])
{
for(int i=0;a[i]!='\0';i++)
{
Sleep(5);
cout<<a[i];
}
}
void Up()
{
cin.getline(User,20);
cin.getline(Pass,20);
}
};
void Stu::Assign()
{
system("CLS");
system("color 2");
Stu A;
A.gotoxy(55,7);cout<<"|------------------------------------|\n";
A.gotoxy(55,8);A.Design("|Name :");A.gotoxy(92,8);cout<<"|";
A.gotoxy(55,9);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,10);A.Design("|class :");A.gotoxy(92,10);cout<<"|";
A.gotoxy(55,11);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,12);A.Design("|Enter Subject :");A.gotoxy(92,12);cout<<"|";
A.gotoxy(55,13);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,14);A.Design("|Roll No :");A.gotoxy(92,14);cout<<"|";
A.gotoxy(55,15);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,16);A.Design("|Admission No :");A.gotoxy(92,16);cout<<"|";
A.gotoxy(55,17);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,18);A.Design("|Date Of Birth (DDMMYY):");A.gotoxy(92,18);cout<<"|";
A.gotoxy(55,19);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,20);A.Design("|year Of Admission :");A.gotoxy(92,20);cout<<"|";
A.gotoxy(55,21);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,22);A.Design("|Father's Name :");A.gotoxy(92,22);cout<<"|";
A.gotoxy(55,23);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,24);A.Design("|Mother's Name :");A.gotoxy(92,24);cout<<"|";
A.gotoxy(55,25);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,26);A.Design("|Group :");A.gotoxy(92,26);cout<<"|";
A.gotoxy(55,27);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,28);A.Design("|Email :");A.gotoxy(92,28);cout<<"|";
A.gotoxy(55,29);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,30);A.Design("|Sex :");A.gotoxy(92,30);cout<<"|";
A.gotoxy(55,31);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,32);A.Design("|Mobile NO. :");A.gotoxy(92,32);cout<<"|";
A.gotoxy(55,33);cout<<"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|";
A.gotoxy(55,34);A.Design("|Address :");A.gotoxy(92,34);cout<<"|";
A.gotoxy(55,35);cout<<"|------------------------------------|";
A.gotoxy(63,8);cin.getline(Name,40);
A.gotoxy(64,10);cin>>Class;
cin.get();
A.gotoxy(72,12);cin.getline(Subject,20);
A.gotoxy(66,14);cin>>Rollno;
A.gotoxy(71,16);cin>>Admno;
cin.get();
A.gotoxy(81,18);cin.getline(Dob,15);
A.gotoxy(76,20);cin>>Yoa;
cin.get();
A.gotoxy(72,22);cin.getline(Fname,40);
A.gotoxy(72,24);cin.getline(Mname,40);
A.gotoxy(64,26);cin.getline(Group,20);
A.gotoxy(64,28);cin.getline(Email,40);
A.gotoxy(62,30);cin.getline(Sex,20);
A.gotoxy(69,32);cin.getline(Pno,15);
A.gotoxy(66,34);cin.getline(Address,20);
cout<<endl;
system("CLS");
}
void Stu::Disp()
{
cout<<"|"<<setw(14)<<Name<<" |";
cout<<setw(5)<<Class<<" |";
cout<<setw(8)<<Subject<<"|";
cout<<setw(4)<<Rollno<<" |";
cout<<setw(7)<<Admno<<" |";
cout<<setw(10)<<Dob<<"|";
cout<<setw(6)<<Yoa<<" |";
cout<<setw(16)<<Fname<<" |";
cout<<setw(14)<<Mname<<" |";
cout<<setw(7)<<Group<<"|";
cout<<setw(20)<<Email<<" |";
cout<<setw(9)<<Sex<<" |";
cout<<setw(10)<<Pno<<" |"<<endl;
cout<<"------------------------------------------------------------------\n";
}
char * Stu::Rname()
{
return Name;
}
char * Stu::Rfname()
{
return Fname;
}
int Stu::Radmno()
{
return Admno;
}
int Stu::Rno()
{
return Rollno;
}
int Stu::Rclass()
{
return Class;
}
char * Stu::Rgroup()
{
return Group;
}
char * Stu::Ruser()
{
return User;
}
char * Stu::Rpass()
{
return Pass;
}
//=====================================================================================
=======================================================
// THIS IS FUNCTION DECLARATION
//=====================================================================================
=======================================================
void Record();
void Display();
void Display1();
void Search();
void Search_Name();
void Search_Fname();
void Search_Admno();
void Search_Group();
void Delete();
void modify();
void main1();
//=====================================================================================
========================================================
// THIS IS MAIN FUNCTION(Intro)
//=====================================================================================
========================================================
int main()
{
system("CLS");
system("color A");
Stu A;
char User1[20],Pass1[20];
A.gotoxy(55,14);cout<<"--------------------------------------\n";
A.gotoxy(55,15);A.Design("| ENTER USERNAME -");cout<<setw(20)<<"|"<<endl;
A.gotoxy(55,16);cout<<"--------------------------------------\n";
A.gotoxy(55,17);A.Design("| ENTER PASSWORD -");cout<<setw(20)<<"|"<<endl;
A.gotoxy(55,18);cout<<"--------------------------------------\n";
A.gotoxy(74,15);cin.getline(User1,20);
A.gotoxy(74,17);cin.getline(Pass1,20);
for(int i=0;;i++)
{
if(strcmp(User1,A.Ruser())==0&&strcmp(Pass1,A.Rpass())==0)
{
system("CLS");
int i;
for(i=0;i<170;i++)
{
A.gotoxy(i,4);cout<<"$";
A.gotoxy(i,38);cout<<"$";
Sleep(20);
}
system("color b");
A.gotoxy(58,8);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
A.gotoxy(58,9);A.Design("| STUDENT MANAGMENT PROGRAM |\n");
A.gotoxy(58,10);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
Sleep(1000);
system("color c");
A.gotoxy(66,15);A.Design("~~~~~~~~~~~~~\n");
A.gotoxy(66,16);A.Design("| MADE BY :-|\n");
A.gotoxy(66,17);A.Design("~~~~~~~~~~~~~\n\n");
Sleep(1000);
system("color B");
A.gotoxy(52,18);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
A.gotoxy(52,19);A.Design("| AMAN BHAGAT,ABHAY SINGH,ROHIT KU SINGH |\n");
A.gotoxy(52,20);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
Sleep(1000);
system("color d");
A.gotoxy(60,21);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~\n");
A.gotoxy(60,22);A.Design("| STUDENT OF CLASS 12TH |\n");
A.gotoxy(60,23);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
Sleep(1000);
system("color c");
A.gotoxy(56,27);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
A.gotoxy(56,28);A.Design("| WITH THE HELP & GUIDANCE OF :- |\n");
A.gotoxy(56,29);A.Design("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
Sleep(1000);
system("color a");
A.gotoxy(62,30);A.Design("~~~~~~~~~~~~~~~~~~~~~~~\n");
A.gotoxy(62,31);A.Design("| MR. R.K. ASNANI SIR |\n");
A.gotoxy(62,32);A.Design("~~~~~~~~~~~~~~~~~~~~~~~\n\n");
A.gotoxy(55,39);system("pause");
main1();
break;
}
else
{
A.gotoxy(0,22);cout<<"**********************************************************\n";
A.gotoxy(65,23);A.Design("| ACCESS DENIED |");
A.gotoxy(0,24); cout<<"*********************************************************\n";
system("pause");
main();
}
}
}
//=====================================================================================
========================================================
// THIS IS MAIN MENU FUNCTION
//=====================================================================================
========================================================
void main1()
{
Stu A;
system("CLS");
A.gotoxy(57,4);cout<<"***********************************\n";
A.gotoxy(57,5);A.Design("|STUDENT MANAGMENT PROGRAM BY A.B |\n");
A.gotoxy(57,6);cout<<"***********************************\n\n";
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MAIN MENU~~~~~~~~~~~~~~~~~~~~~~";
int ch;
do
{
system("color 73");
A.gotoxy(55,10);A.Design("========================================\n");
A.gotoxy(55,11);A.Design("|1.|WRITE A RECORD");cout<<setw(22)<<"||"<<endl;
A.gotoxy(55,12);cout<<"----------------------------------------\n";
A.gotoxy(55,13);A.Design("|2.|DISPLAY ALL RECORDS");cout<<setw(17)<<"||"<<endl;
A.gotoxy(55,14);cout<<"----------------------------------------\n";
A.gotoxy(55,15);A.Design("|3.|LIST OF STUDENT'S CLASS WISE");cout<<setw(8)<<"||"<<endl;
A.gotoxy(55,16);cout<<"----------------------------------------\n";
A.gotoxy(55,17);A.Design("|4.|SEARCH BY STUDENT'S NAME");cout<<setw(12)<<"||"<<endl;
A.gotoxy(55,18);cout<<"----------------------------------------\n";
A.gotoxy(55,19);A.Design("|5.|SEARCH BY FATHER'S NAME");cout<<setw(13)<<"||"<<endl;
A.gotoxy(55,20);cout<<"----------------------------------------\n"
A.gotoxy(55,21);A.Design("|6.|SEARCH BY ADMISSION NO.");cout<<setw(13)<<"||"<<endl;
A.gotoxy(55,22);cout<<"----------------------------------------\n";
A.gotoxy(55,23);A.Design("|7.|SEARCH BY GROUP NAME");cout<<setw(16)<<"||"<<endl;
A.gotoxy(55,24);cout<<"----------------------------------------\n";
A.gotoxy(55,25);A.Design("|8.|DELETE FILE OF A PARTICULAR CLASS");
cout<<setw(3)<<"||"<<endl;
A.gotoxy(55,26);cout<<"----------------------------------------\n";
A.gotoxy(55,27);A.Design("|9.|MODIFY FILE OF A PARTICULAR CLASS");
cout<<setw(3)<<"||"<<endl;
A.gotoxy(55,28);cout<<"----------------------------------------\n";
A.gotoxy(55,29);A.Design("|10|EXIT");cout<<setw(33)<<"||\n";
A.gotoxy(55,30);A.Design("========================================\n\n");
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
A.gotoxy(62,34);A.Design("~~~~~~~~~~~~~~~~~~~~~~~");
A.gotoxy(62,35);A.Design("|ENTER YOUR CHOICE : |");
A.gotoxy(62,36);A.Design("~~~~~~~~~~~~~~~~~~~~~~~");
A.gotoxy(82,35);cin>>ch;
cin.get();
cout<<endl;
switch(ch)
{
case 1 : Record(); break;
case 2 : Display(); break;
case 3 : Display1(); break;
case 4 : Search_Name();break;
case 5 : Search_Fname(); break;
case 6 : Search_Admno(); break;
case 7 : Search_Group(); break;
case 8 : Delete(); break;
case 9 : modify(); break;
case 10 : system("CLS");
A.gotoxy(0,17);cout<<"****************************************\n";
A.gotoxy(65,18);A.Design("_______________________\n");
A.gotoxy(65,19);A.Design("| THANKS FOR VISITING |\n");
A.gotoxy(65,20);A.Design("-----------------------\n");
A.gotoxy(0,21);cout<<"**********************************\n";
exit(0);
default : system("CLS");
A.gotoxy(65,17);A.Design("_________________\n");
A.gotoxy(65,18);A.Design("| Invalid Input |\n");
A.gotoxy(65,19);A.Design("-----------------\n");
A.gotoxy(0,22);cout<<"**************************************\n";
A.gotoxy(60,23);A.Design("|Press Any Key for Main Menu - |");
A.gotoxy(0,24); cout<<"*************************************\n";
A.gotoxy(91,23);getchar();
system("CLS");
main1();
}
} while(ch>=1 && ch<=1);
}
//=====================================================================================
========================================================
// FUNCTION TO RECORD DATA
//=====================================================================================
========================================================
void Record()
{
ofstream fout("Stu.dat",ios::binary|ios::app);
Stu ob,A;
ob.Assign();
fout.write((char*)&ob,sizeof(ob));
fout.close();
A.gotoxy(65,8);A.Design("_________________________\n");
A.gotoxy(65,9);A.Design("| SUCCESSFULLY RECORDED |\n");
A.gotoxy(65,10);A.Design("-------------------------\n");
A.gotoxy(0,12);cout<<"******************************************************\n";
A.gotoxy(15,13);A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO DISPLAY DATA
//=====================================================================================
========================================================
void Display()
{
system("CLS");
system("color E");
cout<<"________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"----------------------------------------------------\n";
Stu ob,A;
ifstream fin("Stu.dat",ios::binary);
while(fin.read((char*)&ob,sizeof(ob)))
{
ob.Disp();
}
fin.close();
cout<<"\n\n";
cout<<"***************************************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO DISPLAY DATA CLASS WISE
//=====================================================================================
========================================================
void Display1()
{
Stu A;
system("CLS");
system("color C");
int clas,f=0;
A.gotoxy(65,11);A.Design("-------------------\n");
A.gotoxy(65,12);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,13);A.Design("-------------------\n");
A.gotoxy(80,12);cin>>clas;
Stu ob;
cin.get();
system("CLS");
cout<<"______________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF |\tFATHER'S
NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX | MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"--------------------------------------------------------------------\n";
ifstream fin("Stu.dat",ios::binary);
while(fin.read((char*)&ob,sizeof(ob)))
{
if(clas==ob.Rclass())
{
ob.Disp();
f=1;
}
}
if(f==0)
{
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<setw(60);A.Design("_________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY SEARCHED |\n");
cout<<setw(60);A.Design("-------------------------\n");
}
fin.close();
cout<<"\n\n";
cout<<"************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO SEARCH BY STUDENT'S NAME
//=====================================================================================
========================================================
void Search_Name()
{
Stu A;
system("CLS");
system("color E");
int clas;
A.gotoxy(65,11);A.Design("-------------------\n");
A.gotoxy(65,12);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,13);A.Design("-------------------\n");
A.gotoxy(80,12);cin>>clas;
char stname[20];
cin.get();
A.gotoxy(65,15);A.Design("---------------------------------\n");
A.gotoxy(65,16);A.Design("|ENTER STUDENTS NAME - \t |\n");
A.gotoxy(65,17);A.Design("---------------------------------\n");
A.gotoxy(88,16);cin.getline(stname,20);
system("CLS");
cout<<"_____________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"------------------------------------------------------------------\n";
ifstream fin("Stu.dat",ios::binary);
Stu ob; int f=0;
while(fin.read((char*)&ob,sizeof(ob)))
{
if(strcmpi(stname,ob.Rname())==0&&clas==ob.Rclass())
{
ob.Disp();
f=1;
}
}
if(f==0)
{
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<setw(60);A.Design("_________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY SEARCHED |\n");
cout<<setw(60);A.Design("-------------------------\n");
}
cout<<"\n\n";
cout<<"*************************************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO SEARCH BY FATHER'S NAME
//=====================================================================================
========================================================
void Search_Fname()
{
Stu A;
system("CLS");
system("color D");
int clas;
A.gotoxy(65,11);A.Design("-------------------\n");
A.gotoxy(65,12);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,13);A.Design("-------------------\n");
A.gotoxy(80,12);cin>>clas;
char Fname[20];
cin.get();
A.gotoxy(65,15);A.Design("---------------------------------\n");
A.gotoxy(65,16);A.Design("|ENTER FATHER'S NAME - \t |\n");
A.gotoxy(65,17);A.Design("---------------------------------\n");
A.gotoxy(88,16);cin.getline(Fname,20);
system("CLS");
cout<<"___________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"-----------------------------------------------------------------\n";
ifstream fin("Stu.dat",ios::binary);
Stu ob; int f=0;
while(fin.read((char*)&ob,sizeof(ob)))
{
if(strcmpi(Fname,ob.Rfname())==0&&clas==ob.Rclass())
{
ob.Disp();
f=1;
}
}
if(f==0)
{
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<setw(60);A.Design("_________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY SEARCHED |\n");
cout<<setw(60);A.Design("-------------------------\n");
}
cout<<"\n\n";
cout<<"***************************************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO SEARCH BY ADMISSION NO.
//=====================================================================================
========================================================
void Search_Admno()
{
system("color C");
Stu A;
system("CLS");
int clas;
A.gotoxy(65,11);A.Design("-------------------\n");
A.gotoxy(65,12);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,13);A.Design("-------------------\n");
A.gotoxy(80,12);cin>>clas;
int Admno;
A.gotoxy(65,15);cout<<"-----------------------------\n";
A.gotoxy(65,16);A.Design("|ENTER ADMISSION NO. - |\n");
A.gotoxy(65,17);cout<<"-----------------------------\n";
A.gotoxy(88,16);cin>>Admno;
cin.get();
system("CLS");
cout<<"_______________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"----------------------------------------------------------------\n";
ifstream fin("Stu.dat",ios::binary);
Stu ob;
int f=0;
while(fin.read((char*)&ob,sizeof(ob)))
{
if(Admno==ob.Radmno()&&clas==ob.Rclass())
{
ob.Disp();
f=1;
}
}
fin.close();
if(f==0)
{
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<setw(60);A.Design("_________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY SEARCHED |\n");
cout<<setw(60);A.Design("-------------------------\n");
}
cout<<"\n\n";
cout<<"*************************************************************************\n";
cout<<"\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ";
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO SEARCH BY GROUP NAME
//=====================================================================================
========================================================
void Search_Group()
{
system("color B");
Stu A;
system("CLS");
int clas;
A.gotoxy(65,11);A.Design("-------------------\n");
A.gotoxy(65,12);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,13);A.Design("-------------------\n");
A.gotoxy(80,12);cin>>clas;
char Gname[20];
cin.get();
A.gotoxy(65,15);A.Design("---------------------------------\n");
A.gotoxy(65,16);A.Design("|ENTER GROUP'S NAME - \t |\n");
A.gotoxy(65,17);A.Design("---------------------------------\n");
A.gotoxy(88,16);cin.getline(Gname,20);
system("CLS");
cout<<"________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"------------------------------------------------------------------\n";
ifstream fin("Stu.dat",ios::binary);
Stu ob; int f=0;
while(fin.read((char*)&ob,sizeof(ob)))
{
if(strcmpi(Gname,ob.Rgroup())==0&&clas==ob.Rclass())
{
ob.Disp();
f=1;
}
}
if(f==0)
{
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<setw(60);A.Design("_________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY SEARCHED |\n");
cout<<setw(60);A.Design("-------------------------\n");
}
cout<<"\n\n";
cout<<"***************************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
//=====================================================================================
========================================================
// FUNCTION TO DELETE DATA
//=====================================================================================
========================================================
void Delete()
{
system("CLS");
system("color 70");
Stu ob,A;
int clas,x=10;
A.gotoxy(65,1);A.Design("-------------------\n");
A.gotoxy(65,2);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,3);A.Design("-------------------\n");
A.gotoxy(80,2);cin>>clas;
ifstream fin("Stu.dat",ios::binary);
ofstream fout("temp.dat",ios::binary|ios::app);
int f=0; char stname[20];
cout<<"\n_______________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"------------------------------------------------------------\n";
while(fin.read((char*)&ob,sizeof(ob)))
{
if(clas==ob.Rclass())
{
ob.Disp();
x+=2;
}
}
fin.close();
fout.close();
cin.get();
A.gotoxy(57,x);A.Design("---------------------------------\n");
A.gotoxy(57,x+1);A.Design("|ENTER STUDENTS NAME -\t\t |\n");
A.gotoxy(57,x+2);A.Design("---------------------------------\n");
A.gotoxy(80,x+1);cin.getline(stname,20);
fin.open("Stu.dat",ios::binary);
fout.open("temp.dat",ios::binary|ios::app);
while(fin.read((char*)&ob,sizeof(ob)))
{
if(strcmpi(stname,ob.Rname())!=0)
{
fout.write((char*)&ob,sizeof(ob));
}
else
f=1;
}
fin.close();
fout.close();
remove("Stu.dat");
rename("temp.dat","Stu.dat");
if(f==0)
{
cout<<"\n";
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
cout<<"\n";
cout<<setw(60);A.Design("________________________\n");
cout<<setw(60);A.Design("| SUCCESSFULLY DELETED |\n");
cout<<setw(60);A.Design("------------------------\n");
}
cout<<"\n\n";
cout<<"***************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
//=====================================================================================
========================================================
// FUNCTION TO MODIFY DATA
//=====================================================================================
========================================================
void modify()
{
system("CLS");
system("color A");
Stu ob,A;
fstream fio("Stu.dat",ios::in|ios::out|ios::binary);
int clas,x=10;
A.gotoxy(65,1);A.Design("-------------------\n");
A.gotoxy(65,2);A.Design("|ENTER CLASS - |\n");
A.gotoxy(65,3);A.Design("-------------------\n");
A.gotoxy(80,2);cin>>clas;
cout<<"\n________________________________________________________________\n";
cout<<"|\tNAME \t|CLASS |SUBJECT |ROLL |ADMISSION | DATE OF |YEAR OF
|\tFATHER'S NAME | MOTHER'S NAME| GROUP|\tEMAIL ID |\t SEX |
MOBILE NO |\n";
cout<<"|";
cout<<setw(16)<<"|";
cout<<setw(7)<<"|";
cout<<setw(9)<<"|";
cout<<setw(6)<<"NO. |";
cout<<setw(7)<<"NO.";
cout<<setw(4)<<"|";
cout<<setw(8)<<" BIRTH";
cout<<setw(3)<<"|";
cout<<setw(8)<<"ADMISION";
cout<<setw(1)<<"|";
cout<<setw(18)<<"|";
cout<<setw(16)<<"|";
cout<<setw(8)<<"|";
cout<<setw(22)<<"|";
cout<<setw(11)<<"|";
cout<<setw(13)<<"|\n";
cout<<"-----------------------------------------------------------------\n";
while(fio.read((char*)&ob,sizeof(ob)))
{
if(clas==ob.Rclass())
{
ob.Disp();
x+=2;
}
}
fio.close();
char stname[20];
cin.get();
A.gotoxy(57,x);A.Design("---------------------------------\n");
A.gotoxy(57,x+1);A.Design("|ENTER STUDENTS NAME - \t |\n");
A.gotoxy(57,x+2);A.Design("---------------------------------\n");
A.gotoxy(80,x+1);cin.getline(stname,20);
fio.open("Stu.dat",ios::in|ios::out|ios::binary);
int f=0;
while(fio.read((char*)&ob,sizeof(ob)))
{
if(strcmpi(stname,ob.Rname())==0&&clas==ob.Rclass())
{
fio.seekg(0,ios::cur);
ob.Assign();
fio.seekp(fio.tellg() - sizeof(ob));
fio.write((char*)&ob,sizeof(ob));
f=1;
break;
}
}
fio.close();
if(f==0)
{
cout<<"\n";
cout<<setw(65);A.Design("_____________\n");
cout<<setw(65);A.Design("| NOT FOUND |\n");
cout<<setw(65);A.Design("-------------\n");
}
else
{
system("CLS");
A.gotoxy(59,8);A.Design("_________________________\n");
A.gotoxy(59,9);A.Design("| SUCCESSFULLY MODIFIED |\n");
A.gotoxy(59,10);A.Design("------------------------\n");
}
cout<<"\n\n";
cout<<"****************************************************************************\n";
A.Design("\t\t\t\t\t\t\t\|Press Any Key for Main Menu - ");
getchar();
system("CLS");
main1();
}
Output
Login Screen
. INTRODUCTION
. Main menu
. Inserting Record
. display all Records
Search By Class
Search By Stu. Name
Search By father's. Name
Search By Admission No.