Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Certificate
2. Acknowledgement
3. Hierarchical Diagram of the Project Structure
4. Data required as input
5. Classes and their functions
6. Project Code
7. Output Screens
8. Bibliography
CERTIFICATE
This is to certify that Sushank Mishra, student of class
XII-B, Summer Fields School has successfully completed
the project “Student Data Management System” under
the guidance of Mr. Gurjeet Singh during the academic
session 2019-20 in the partial fulfillment of C++
Practical Examination conducted by CBSE, New Delhi.
I would also like to thank my parents and friends who have also helped me
through their valuable inputs.
It is the culmination of the efforts made by me and these people that has
helped the project to emerge the way it has!!
Sushank Mishra
XII-B
HIERARCHICAL DIAGRAM OF PROJECT
STRUCTURE
Main
Menu
private :
int admno;
char name[30];
char fname[30];
int std;
char section;
int phy;
int chem;
int math;
int comp;
int eng;
int total;
float per;
char grade[3];
public:
void main_menu(); //function to display main menu
void del_record (); // function to delete a record from the data file
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
//class definition
class report {
private :
int admno,std,phy,chem,math,comp,eng;
char name[30],fname[30],section,grade[3];
float per,total;
public :
}
void calculate() //function to obtain final percentage and grade for student
{
total = phy+chem+math+comp+eng;
per = floor(total/5.0);
if(per>=95)
strcpy(grade,"A+");
}
/*-------Accessor functions to obtain specific student data for manipulation-------*/
int getadmno() //accesses admission no of student
{
return admno;
}
char getsection() //accesses section of the student
{
return section;
}
int getstd() //accesses standard of the student
{
return std;
}
int checkname(char m[30]) //verifies the name of the student
{
if(strcmpi(m,name)==0)
return 0;
else
return 1;
}
}s1;
void main_menu(); //function to display main menu
void display_menu()
{
int choice;
do
{
clrscr();
cout<<"\n\t===================================================";
cout<<"\n\n\n\t\t D i s p l a y M e n u\n\n";
cout<<"\n\t===================================================";
cout<<"\n\n\t\t1. Single Student";
cout<<"\n\n\t\t2. Single class";
cout<<"\n\n\t\t3. Exit ";
cout<<"\n\n\t\t Enter your choice (1..3) : ";
cin>>choice;
switch(choice)
{
case 1: report_single();
break;
case 2: report_class();
break;
case 3: break;
default :
cout<<"\n Wrong Choice.... Try again";
}
}while(choice!=3);
void search_menu()
{
int choice;
do
{
clrscr();
cout<<"\n\t================================================";
cout<<"\n\n\n\t\t S e a r c h M e n u \n\n";
cout<<"\n\t================================================";
cout<<"\n\n\t\t1. Admno Student";
cout<<"\n\n\t\t2. Student Name";
cout<<"\n\n\t\t3. Class wise";
cout<<"\n\n\t\t4. Exit ";
cout<<"\n\n\n\n\t\t Enter your choice (1..4) : ";
cin>>choice;
switch(choice)
{
case 1: search_admno( );
getch();
break;
case 2: search_name();
getch();
break;
case 3: search_class();
getch();
break;
case 4: break;
default :
cout<<"\n Wrong Choice.... Try again";
}
}while(choice!=4);
void search_name( )
{
ifstream fin;
fin.open("report.dat",ios::binary);
char tname[30];
int flag=0;
clrscr();
cout<<"\n Enter Name to search :";
cin>>tname;
while(fin.read((char*)&s1,sizeof(s1)))
{
if(s1.checkname(tname)==0)
{
clrscr();
cout<<"\n Student Information ";
cout<<"\n--------------------------------------------------------"<<endl;
s1.disp_data();
flag=1;
}
}
fin.close();
if(flag==0)
cout<<"\n No such name : "<<strupr(tname)<<" exist in our record... Try again";
}
clrscr();
cout<<"\n Enter student Class to search :";
cin>>tstd;
cout<<"\n Enter student section to search :";
cin>>tsect;
clrscr();
cout<<"\n Class :"<<tstd<<" - "<<tsect<<endl;
while(fin.read((char*)&s1,sizeof(s1)))
{
if(tsect==s1.getsection() && tstd == s1.getstd())
{
s1.disp_data();
flag=1;
getch();
}
}
cout<<"\n-------------------------------------------------------------------------------"<<endl;
fin.close();
if(flag==0)
cout<<"\n\n information Not available for class :"<<tstd <<" - "<<tsect;
void search_admno( )
{
ifstream fin;
fin.open("report.dat",ios::binary);
int tadmno;
int flag=0;
clrscr();
cout<<"\n Enter Admission Number to search : ";
cin>>tadmno;
while(fin.read((char*)&s1,sizeof(s1)))
{
if(tadmno == s1.getadmno())
{
clrscr();
cout<<"\n Student Information ";
cout<<"\n--------------------------------------------------------"<<endl;
s1.disp_data();
flag = 1;
}
}
fin.close();
if(flag==0)
cout<<"\n\n Admission No : "<<tadmno <<" does not exist.... Try again";
void report_single()
{
int tadmno;
int flag =0;
ifstream fin;
fin.open("report.dat",ios::binary); //binary mode
clrscr();
cout<<"\n Enter admission No : ";
cin>>tadmno;
while(fin.read((char*)&s1, sizeof(s1)))
{
if(tadmno ==s1.getadmno())
s1.single_report_card(); // function to display single report card
else
flag =1;
}
fin.close();
if(flag==1)
cout<<"\n\n Admission No :"<<tadmno <<" does not exist.... Try again";
getch();
}
int tstd;
char tsect;
ifstream fin;
fin.open("report.dat",ios::binary);
clrscr();
clrscr();
while(fin.read((char*)&s1, sizeof(s1)))
{
if( s1.getsection()==tsect && s1.getstd() == tstd)
{
s1.single_report_card();
getch();
cout<<endl;
}
}
getch();
}
void del_record ()
{
fstream f1;
fstream f2;
int tadmno;
int flag =0;
clrscr();
cout<<"\n Enter admno to delete :";
cin>>tadmno;
f1.open("report.dat",ios::binary|ios::in);
f2.open("temp.dat",ios::binary|ios::app);
while(f1.read((char*)&s1, sizeof(s1)))
{
if(tadmno!=s1.getadmno())
f2.write((char*)&s1,sizeof(s1));
else
flag=1;
}
f1.close();
f2.close();
remove("report.dat");
rename("temp.dat","report.dat");
if(flag==1)
cout<<"\n\n Record Sucessfully removed ";
else
cout<<"\n Admission No :"<<tadmno <<" does not exist...Try again";
getch();
}
void modify_record( )
{
ifstream fin;
ofstream fout;
int tadmno;
int flag =0;
clrscr();
cout<<"\n Enter Admno to Modify :";
cin>>tadmno;
fin.open("report.dat",ios::binary);
fout.open("temp.dat",ios::binary);
while(fin.read((char*)&s1, sizeof(s1)))
{
if(tadmno == s1.getadmno())
{ s1.read_data(); s1.calculate(); flag=1; }
fout.write((char*)&s1,sizeof(s1));
}
fin.close();
fout.close();
remove("report.dat");
rename("temp.dat","report.dat");
if(flag==1)
cout<<"\n\n Record Sucessfully modified ";
else
cout<<"\n Admission No :"<<tadmno <<" does not exist...Try again";
getch();
Modifying a Record
Search By Class
Display Menu