0% found this document useful (0 votes)
73 views

A Computer Project 12 A

The document is a student report card generator project created by Aniruddha Das, a class 12 student. It includes an index, descriptions of the data required, classes and functions used, hardware and software requirements, and code listing. The project allows teachers to generate student report cards by taking student information as input, calculating marks, percentage, and grade, and generating reports for individual students, entire classes, or the whole school.

Uploaded by

Aniruddha Das
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

A Computer Project 12 A

The document is a student report card generator project created by Aniruddha Das, a class 12 student. It includes an index, descriptions of the data required, classes and functions used, hardware and software requirements, and code listing. The project allows teachers to generate student report cards by taking student information as input, calculating marks, percentage, and grade, and generating reports for individual students, entire classes, or the whole school.

Uploaded by

Aniruddha Das
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Student Report

Card Generator
(Computer Project)

Made By:
Aniruddha Das
Roll No. : 41
Class: XII-A

Session: 2019-20

Submitted to:
Mrs. Alpa Biju

Delhi Public School


Bopal Square, Near Bopal Railway Crossing, Ahmedabad, Gujarat 38005
Certificate

This is to certify that the “Student Report card Maker” is made by: ……………………………….
Roll No: ………………………………………..
Under my supervision and Guidance.
This is their authentic work for the fulfillment of computer project work under C.B.S.E. computer
Practical Examination for the session 2019-20.

(Mrs. Alpa Biju)


Acknowledgement

This is the right time to express my gratitude towards my 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 mine, 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.

Yours Sincerely

[Aniruddha Das]
Index

1. About Student Report card Maker


2. Data required as input
3. Classes and their functions
4. Hardware and Software requirement
5. Project Listing
6. Output Screens
7. Reference
About The Project

Student report card maker is a simple computer program designed to help teachers to generate
student’s 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 subjects.

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 are given in this project for easy management.
Data Required as Input

• Admno - To store student administration no.


• Name - Name of student
• Father Name - Father’s name of student
• Class & section - Class and section of student
• Session - Session
• Marks obtained in 5 subject - 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
Classes & Their Function
class report {

private:
int phy,chem,math,comp,eng,total,admno,std;
char name[30], fname[30], section, 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(); // function to show class wise report of whole


// school
};
Hardware & Software Requirements

Hardware required:
 64 MB RAM
 Pentium-1 Processor and Above
 Mouse
 Keyboard

Software requirement:
 Operating System – Windows or any other supported
 C++ Compiler
 IDE ( Integrated Development Environment )
Code

#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>

class report {
private :
int phy,chem,math,comp,eng,total,admno,std;
char name[30],fname[30],section,grade[3];
float per;
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( );
void search_admno( );
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
};

/* function to show main menu ------------*/

void report ::main_menu()


{
int choice;
do
{
clrscr();
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 again";
}
}while(choice!=6);
return;
}

/*----------- function to create report menu -----------*/

void report ::report_menu()


{
int choice;
do
{
clrscr();
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. Exit ";
cout<<"\n\n\t\t Enter your choice (1..3) : ";
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: break;
default :
cout<<"\n Wrong Choice.... Try agian";
} // end of switch
}while(choice!=3);

return;
}

/*------------function to create search menu---------------*/

void report ::search_menu()


{
int choice;
do
{
clrscr();
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. Exit ";
cout<<"\n\n\n\n\t\t Enter your choice (1..3) : ";
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: break;

default :
cout<<"\n Wrong Choice.... Try again";
}
}while(choice!=3);
return;
}

/*------------function to read data members from keyboard------*/

void report:: read_data( )


{
clrscr();
cout<<"\n Enter Adm No :";
cin>>admno;
cout<<"\n Enter Name : ";
gets(name);
cout<<"\n Enter Father Name : ";
gets(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 obtained in English : ";
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;

clrscr();
cout<<"\n Enter Name to search :";
gets(tname);

while(fin.read((char*)this,sizeof(report)))
{
if(strcmpi(tname,name)==0)
{
clrscr();
cout<<"\n Student Information ";
cout<<"\n--------------------------------------------------------"<<endl;
disp_data();
flag=1;
}
}
fin.close();
if(flag==0)
cout<<"Student "<<tname<<" does not exist in the database.... Try again";
return;
}

/*------------function to search record according to student admno ------------*/

void report :: search_admno( )


{
ifstream fin;
fin.open("report.dat");
int tadmno;
int flag=0;

clrscr();
cout<<"\n Enter Admission Number to search : ";
cin>>tadmno;

while(fin.read((char*)this,sizeof(report)))
{
if(tadmno == admno)
{
clrscr();
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()
{
clrscr();

cout<<"\n\t\t Delhi Public School,Bopal ";


cout<<"\n\t\t Session : 2019-20";
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(DFH)-----*/

void report:: 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*)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");
clrscr();
cout<<"n\n Enter Class (1..12) :";
cin>>tstd;
cout<<"\n Enter section :";
cin>>tsect;

clrscr();
cout<<"\n\t\t Delhi Public School,Bopal ";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2019-20"<<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 Delhi Public School,Bopal ";
cout<<"\n\t\t Class :"<<tstd<<"-"<<tsect<<"\t\t Session : 2019-20"<<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 :"<<"Aniruddha Das";
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;
clrscr();
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;
clrscr();
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;
}
Screenshots
Reference
1. Computer projects
1. By Mrs. Alpa Biju

2. Computer science
1. By Sumita Arora
3. Online reference
1. www.pscode.com
2. www.programmersheaven.com

You might also like