Student Report
Card Maker
(C.S Project)
Made By
Ayush Kumar
Roll No. :02
Session : 2018-19
Submitted to
Mrs. Rachna Gupta
KENDIYA VIDYALAYA D.L.W KANCHANPUR
Acknowledgement
This is the right time to express our gratitude towards our
teachers/ mentor for their constant support and guidance.
These are only few words which we have written here to
show our respect to our teachers.
Though they will not among us after this session but their
lesson will always guide us in future also.
This project is ousr , but it is their inspiration and constant
push that we are now able to compile the whole knowledge
we learnt through out 11 & 12, in the form of this project.
Last but not least sir we would love to say thank you.
Yours Sincerely
[ Ayush Kumar ]
Index
1. About C++
2. About Student Report card Maker
3. Hierarchical Diagram of Student report card
4. Data required as input
5. Report required as output
6. Classes and their functions
7. Hardware and Software requirement
8. Project Listing
9. Output Screens
10. Reference
About Student Report card Maker
Student report card maker is a simple computer
program designed to help teachers to generate
students report card after every session.
The whole program is designed in this way that you
can expand it up to any level. Initially it is used to feed
students information and marks obtained in five
subject.
This information is recorded in a binary file
“report.dat” , so that this recorded information can be
used later on at any stage.
Modification , deletion and searching , reporting
facility is given in this project for easy management.
This program is fact and accurate, since it is written in
one of the oldest programming language ie C++.
Hierarchical diagram of Project
Main
menu
Delete Modify Search Report Close
Add Student Student Student Menu menu Application
Class & Session
Name Admno Single Class wise
section wise
Data Required as Input
• Admno - To store student admno no
• Name - name of student
• Father Name - father Name of student
• Class & section - class and section of student
• Session - session
• Marks obtained in 5 subject -
• Total Mark - Total marks
• Percentage - percentage marks of student
• Grade - Grade of student
Criteria for Grade calculation
Percentage mark Grade
>=95 A+
<95 and >=90 A
<90 and >=80 B+
<80 and >=70 B
<70 and >=60 C+
<60 C
Output Required
• Single student report card
• Class wise student report card
• Session wise result
• Search - admno
• Search – class & section
• Search – name class & section
Classes & Their function
class report {
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 search_menu(); // function to display search menu
void report_menu( ); // function to display report menu
void read_data( ); // function to read all the data members from the
//keyboard
void calculate(); // function to calculate total marks, per and grade
void disp_data(); // function to display data members on the screen
void add_record (); // function to add student record in a data file
void del_record (); //function to delete a record from the data file
void modify_record( ); // Function to modify a record in a data file
void search_name( ); //function to read student name and search the
Information in the given database file, if it is
// available then display student information otherwise
display “ Name does not exist”
void search_admno( ); // function to read student admno and search the
Information in the given database file, if it is
void search_class(); // function to read student admno and search the
Information in the given database file, if it is
// available then display student information
otherwise display “ Name does not exist”
void single_report_card();
void report_single(); // function to show single student report card
void report_class(); // function to show class report of a single class
void report_school(); // fucntion to show class wise report of whole
// school
};
Program Listing
/*-----Student Report card Maker
made by : 1. Ayush Kumar
Session : 2018-19
School Name : Kendriya Vidyalaya Kanchanpur
*/
#include<iostream>
#include<fstream>
#include<conio.h>
#include<string.h>
#include<cstdlib>
using namespace std;
class report {
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 search_menu(); // function to display search menu
void report_menu( ); // function to display report menu
void read_data( ); // function to read all the data members from the
//keyboard
void calculate(); // function to calculate total marks, per and grade
void disp_data(); // function to display data members on the screen
void add_record (); // function to add student record in a data file
void del_record (); //function to delete a record from the data file
void modify_record( ); // Function to modify a record in a data file
void search_name( ); //function to read student name and search the
Information in the given database file, if it is
// available then display student information otherwise
display “ Name does not exist”
void search_admno( ); // function to read student admno and search the
Information in the given database file, if it is
// available then display student information
otherwise display “ Name does not exist”
void search_class(); // function to read student admno and search the
Information in the given database file, if it is
// available then display student information
otherwise display “ Name does not exist”
void single_report_card();
void report_single(); // function to show single student report card
void report_class(); // function to show class report of a single class
void report_school(); // fucntion to show class wise report of whole
// school
};
/* function to show main menu ------------*/
void report ::main_menu()
{
int choice;
do
{
system("cls");
cout<<"\n\n\n\t\t R e p o r t C a r d M e n u\n\n";
cout<<"\n\n\t\t1. Add New Student ";
cout<<"\n\n\t\t2. Delete Student";
cout<<"\n\n\t\t3. Modify student";
cout<<"\n\n\t\t4. Search Menu";
cout<<"\n\n\t\t5. Report Menu ";
cout<<"\n\n\t\t6. Exit ";
cout<<"\n\n\t\t Enter your choice (1..6) : ";
cin>>choice;
switch(choice)
{
case 1: add_record();// function to call add record
break;
case 2: // function to call delete record
del_record();
break;
case 3: // function to call modify record
modify_record();
break;
case 4: search_menu();
break;
case 5: report_menu();
break;
case 6: break;
default :
cout<<"\n Wrong Choice.... Try agian";
} // end of switch
}while(choice!=6);
return;
}
/*----------- function to create report menu -----------*/
void report ::report_menu()
{
int choice;
do
{
system("cls");
cout<<"\n\n\n\t\t R e p o r t M e n u\n\n";
cout<<"\n\n\t\t1. Single Student";
cout<<"\n\n\t\t2. Single class";
cout<<"\n\n\t\t3. Whole School";
cout<<"\n\n\t\t4. Exit ";
cout<<"\n\n\t\t Enter your choice (1..4) : ";
cin>>choice;
switch(choice)
{
case 1: // function to call single student
report_single();
break;
case 2: // function to display class report
report_class();
break;
case 3: // function to display whole school report card
report_school();
break;
case 4: break;
default :
cout<<"\n Wrong Choice.... Try agian";
} // end of switch
}while(choice!=4);
return;
}
/*------------function to create search menu---------------*/
void report ::search_menu()
{
int choice;
do
{
system("cls");
cout<<"\n\n\n\t\t S e a r c h M e n u \n\n";
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: // function to call search_admno
search_admno( );
getch();
break;
case 2: // function to call search_name
search_name();
getch();
break;
case 3: // function to call
search_class();
getch();
break;
case 4: break;
default :
cout<<"\n Wrong Choice.... Try agian";
} // end of switch
}while(choice!=4);
return;
}
/*------------function to read data members from keyboard------*/
void report:: read_data( )
{
system("cls");
cout<<"\n Enter Adm No :";
cin>>admno;
cout<<"\n Enter Name : ";
cin>>name;
cout<<"\n Enter Father Name : ";
cin>>fname;
cout<<"\n Enter class : ";
cin>>std;
cout<<"\n Enter Section :";
cin>>section;
cout<<"\n Enter marks obtained in Phyics : ";
cin>>phy;
cout<<"\n Enter marks obtained in Chemistry : ";
cin>>chem;
cout<<"\n Enter marks obtained in Maths : ";
cin>>math;
cout<<"\n Enter marks obtained in computer : ";
cin>>comp;
cout<<"\n enter marks obtaine in emglish : ";
cin>>eng;
return;
}
/*------------function to calculate total marks, per and grade-----------*/
void report::calculate()
{
total = phy+chem+math+comp+eng;
per = total/5.0;
if(per>=95)
strcpy(grade,"A+");
if(per<95 && per>=90)
strcpy(grade,"A");
if(per<90 && per>=80)
strcpy(grade,"B+");
if(per<80 && per>=70)
strcpy(grade,"B");
if(per<70 && per>=60)
strcpy(grade,"C+");
if(per<60)
strcpy(grade,"C");
return;
}
/*---------function to display data members --------------*/
void report::disp_data()
{
cout<<"\n Admno : "<<admno;
cout<<"\n Student Name : "<<name;
cout<<"\n Father Name : "<<fname;
cout<<"\n Class & Section : "<<std<<"-"<<section;
cout<<"\n Physics : "<<phy;
cout<<"\n Chemistry : "<<chem;
cout<<"\n Maths : "<<math;
cout<<"\n Computer : "<<comp;
cout<<"\n English : "<<eng;
cout<<"\n Total Marks : "<<total;
cout<<"\n Percentage : "<<per;
cout<<"\n Grade : "<<grade;
return ;
}
/*-------------function to add record in data file ------*/
void report::add_record ()
{
ofstream fout;
fout.open("report.dat",ios::app);
read_data();
calculate();
fout.write((char*)this, sizeof(report));
fout.close();
}
/*--------------function to search student record name wise ------*/
void report::search_name( )
{
ifstream fin;
fin.open("report.dat");
char tname[30];
int flag=0;
system("cls");
cout<<"\n Enter Name to search :";
cin>>tname;
while(fin.read((char*)this,sizeof(report)))
{
if(strcmpi(tname,name)==0)
{
system("cls");
cout<<"\n Student Information ";
cout<<"\n--------------------------------------------------------"<<endl;
disp_data();
flag=1;
}
}
fin.close();
if(flag==0)
cout<<"\n No such name : "<<strupr(tname)<<" exist in our record... Try again";
return;
}
/*----------function to call search class wise -------------------------------*/
void report::search_class()
{
ifstream fin;
fin.open("report.dat");
char tsect;
int tstd;
int flag;
system("cls");
cout<<"\n Enter student Class to search :";
cin>>tstd;
cout<<"\n Enter student section to search :";
cin>>tsect;
system("cls");
cout<<"\n Class :"<<tstd<<" - "<<tsect<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"Admno\tName\tFname\t Phy \t Chem\t Math \t Comp \t Eng \t Total \t per\n";
cout<<"-------------------------------------------------------------------------------"<<endl;
while(fin.read((char*)this,sizeof(report)))
{
if(tsect==section && tstd == std)
{
cout<<admno<<"\t"<<name<<"\t"<<fname<<"\t"<<phy<<"\t"<<chem<<"\t"<<math<<"\t"<<comp<<"\t"<<eng
<<"\t"<<total<<"\t"<<per<<endl;
flag=1;
}
}
cout<<"-------------------------------------------------------------------------------"<<endl;
fin.close();
if(flag==0)
cout<<"\n\n information Not availabl for class :"<<tstd <<" - "<<tsect;
return;
/*------------function to search record according to student admno ------------*/
void report :: search_admno( )
{
ifstream fin;
fin.open("report.dat");
int tadmno;
int flag=0;
system("cls");
cout<<"\n Enter Admission Number to search : ";
cin>>tadmno;
while(fin.read((char*)this,sizeof(report)))
{
if(tadmno == admno)
{
system("cls");
cout<<"\n Student Information ";
cout<<"\n--------------------------------------------------------"<<endl;
disp_data();
flag = 1;
}
}
fin.close();
if(flag==0)
cout<<"\n\n Admission No : "<<tadmno <<" does not exist.... Try again";
return;
/*--------function to display single report card---------*/
void report::single_report_card()
{
system("cls");
cout<<"\n\t\t Kendriya Vidyalaya Kanchanpur";
cout<<"\n\t\t Session : 2018-19";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n\n Admno :"<<admno;
cout<<"\n\n Name :"<<name <<"\t\t Father Name :"<<fname<<"\t\t class :"<<std<<"-"<<section;
cout<<"\n\n-------------------------------------------------------------------------------";
cout<<"\n Subject\tMax Mark\tMin Mark\t Marks Obtained";
cout<<"\n--------------------------------------------------------------------------------";
cout<<"\n Physics\t100\t\t33\t\t\t"<<phy;
cout<<"\n\n Chemistry\t100\t\t33\t\t\t"<<chem;
cout<<"\n\n Maths\t\t100\t\t33\t\t\t"<<math;
cout<<"\n\n Computer\t100\t\t33\t\t\t"<<comp;
cout<<"\n\n English\t100\t\t33\t\t\t"<<eng;
cout<<"\n\n-------------------------------------------------------------------------------";
cout<<"\n Total Marks :\t\t"<<total<<"\t\tPercentage : "<<per<<"\tGrade :"<<grade;
cout<<"\n---------------------------------------------------------------------------------";
return;
}
/*----------function to show single student report-----*/
void report:: report_single()
{
int tadmno;
int flag =0;
ifstream fin;
fin.open("report.dat",ios::binary); //binary mode
system("cls");
cout<<"\n Enter admission No : ";
cin>>tadmno;
while(fin.read((char*)this, sizeof(report))) // read record and check eof
{
if(tadmno ==admno)
single_report_card(); // function to display single report card
else
flag =1;
}
fin.close();
if(flag==0)
cout<<"\n\n Admission No :"<<tadmno <<" does not exist.... Try again";
getch();
return;
}
/*-------------function to display class wise report card------------*/
void report:: report_class()
{
int tstd;
char tsect;
int row =6;
int no =0;
ifstream fin;
fin.open("report.dat");
system("cls");
cout<<"n\n Enter Class (1..12) :";
cin>>tstd;
cout<<"\n Enter section :";
cin>>tsect;
system("cls");
cout<<"\n\t\t Kendriya vidyalay Kanchanpur";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2018-19"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"Admno\tName\tFname\t Phy \t Chem\t Math \t Comp \t Eng \t Total \t per\n";
cout<<"-------------------------------------------------------------------------------"<<endl;
while(fin.read((char*)this, sizeof(report)))
{
if(tstd==std && tsect== section )
{
row= row+1;
no++;
if(row>=30)
{
cout<<"\n\n Press any key to continue ................";
getch();
cout<<"\n\t\t Kendriya vidyalay Kanchanpur ";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2012-13"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"Admno\tName\tFname\t Phy \t Chem\t Math \t Comp \t Eng \t Total \t per\n";
cout<<"-------------------------------------------------------------------------------"<<endl;
row =6;
}
cout<<admno<<"\t"<<name<<"\t"<<fname<<"\t"<<phy<<"\t"<<chem<<"\t"<<math<<"\t"<<comp<<"\t"<<eng
<<"\t"<<total<<"\t"<<per<<endl;
}
}
fin.close();
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"\n Total Student : "<<no<<" Report prepared By :"<<" Ayush kumar";
getch();
return ;
/*-------------function to prepare whole school report card-----------------------*/
void report:: report_school()
{
int tstd;
char tsect;
int row =6;
int no =0;
ifstream fin;
fin.open("report.dat");
system("cls");
cout<<"\n\t\t Kendriya vidyalay Kanchanpur ";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2018-19"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"Admno\tName\tFname\t Phy \t Chem\t Math \t Comp \t Eng \t Total \t per\n";
cout<<"-------------------------------------------------------------------------------"<<endl;
while(fin.read((char*)this, sizeof(report)))
{
row= row+1;
no++;
if(row>=30)
{
cout<<"\n\n Press any key to continue ................";
getch();
cout<<"\n\t\t Kendriya vidyalay Kanchanpur ";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2018-19"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"Admno\tName\tFname\t Phy \t Chem\t Math \t Comp \t Eng \t Total \t per\n";
cout<<"-------------------------------------------------------------------------------"<<endl;
row =6;
}
cout<<admno<<"\t"<<name<<"\t"<<fname<<"\t"<<phy<<"\t"<<chem<<"\t"<<math<<"\t"<<comp<<"\t"<<eng
<<"\t"<<total<<"\t"<<per<<endl;
}
fin.close();
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"\n Total Student : "<<no<<" Report prepared By :"<<" Ayush kumar";
getch();
return ;
/*------------function to delete single record from binay file report.dat------*/
void report::del_record ()
{
ifstream fin;
ofstream fout;
int tadmno;
int flag =0;
system("cls");
cout<<"\n Enter admno to delete :";
cin>>tadmno;
fin.open("report.dat",ios::binary);
fout.open("temp.dat");
while(fin.read((char*)this, sizeof(report)))
{
if(tadmno!=admno)
fout.write((char*)this,sizeof(report));
else
flag=1;
}
fin.close();
fout.close();
remove("report.dat"); // function from stdio.h header file
rename("temp.dat","report.dat"); // function from stdio.h header file
if(flag==1)
cout<<"\n\n Record Sucessfully removed ";
else
cout<<"\n Admission No :"<<tadmno <<" does not exist...Try again";
getch();
return;
}
/*---------function to modify student information-----------------------*/
void report:: modify_record( )
{
ifstream fin;
ofstream fout;
int tadmno;
int flag =0;
system("cls");
cout<<"\n Enter Admno to Modify :";
cin>>tadmno;
fin.open("report.dat",ios::binary);
fout.open("temp.dat");
while(fin.read((char*)this, sizeof(report)))
{
if(tadmno == admno)
{ read_data(); calculate(); flag=1; }
fout.write((char*)this,sizeof(report));
}
fin.close();
fout.close();
remove("report.dat"); // function from stdio.h header file
rename("temp.dat","report.dat"); // function from stdio.h header file
if(flag==1)
cout<<"\n\n Record Sucessfully modified ";
else
cout<<"\n Admission No :"<<tadmno <<" does not exist...Try again";
getch();
return;
/*-----------main function to implement report class ------------*/
int main()
{
report r;
r.main_menu();
return 0;
}
OUTPUT SCREENS
Main Menu
Add Student Record
Modify Record
Search Menu
Report Menu
Single student report card
Class wise report
Reference
1. Computer science
1. By Sumita Arora
2. The art and Science of Computer Project
1. SitePoint
3. Online reference
1. www.class-12-computer-project.blogspot.in