Академический Документы
Профессиональный Документы
Культура Документы
SCHOOL
COMPUTER SCIENCE (083)
PROJECT FILE
ON
“STUDENT REPORT CARD”
(2018-19)
CERTIFICATE
ACKNOWLEDGEMENT
CONCEPT USED
CODING
OUTPUT
REQUIREMENTS
BIBLIOGRAPHY
CERTIFICATE OF AUTHENTICATION
_____________________
Teacher In-charge
Date: ______________
_____________________ _______________________
"I have taken efforts in this project. However, it would not have been Possible without the
kind support and help of many individuals and Organizations.
I am highly indebted to VIDYA BAL BHAWAN SR. SEC SCHOOL for their guidance and
constant supervision as well as for providing necessary information regarding the project &
also for theirs support in completing the project.
I would like to express my gratitude towards my parents & member of school for their kind
cooperation and encouragement which help me in completion of this project.
I would like to express my special gratitude and thanks to Ms. POONAM RAWAT for giving
me such attention and time.
My thanks and appreciations also go to my colleague in developing the project and people
who have willingly helped me out with their abilities."
CONCEPTS USED
OVERVIEW OF C++
Object Oriented Programming (C++) revolves around the concept of object and its class. A
class is similar to a C structure except that the definition of the data structure and all of the
functions that operate on the structure are grouped together at one place. An object is an
instance of a class (an instance of the data structure); object share the same functions with
other objects of the same class, but each object (each instance) has its own copy of the
data structure. A class thus defines two aspects of the object-the data they contain and the
behavior they have.
• Classes
• Member Function
• Inheritance
• Data Abstraction
• Data Encapsulation
• Polymorphism
• Overloading
• Reusability
Classes
Classes are data types based on which object are created. Objects with similar properties
and methods are grouped together to form a Class. Thus, a Class represents a set of
individual object. Characteristics of an object are represented in a class as Properties. The
actions that can be performed by objects become functions of the class and are referred to
as Methods. No memory is allocated when a class is created .Memory is allocated only
when an object is created.
Member Functions
These are functions which are considered part of the objects and are declared in the class
definition. They are often referred to as methods of the class. In addition to member
functions, a class's behavior is also defined by:
What to do when to create a new object (the constructor for that object) -in other words,
initialize the object's data.
What to do when you delete an object (the destructor for that object).
Private vs. public members-A public member of a class is one that can be read or written by
anybody in the case of a data member, or called by anybody in the case of a member
function. A Private member can only be read, written or called by a member function of the
class.
Inheritance
Inheritance is the process of forming a new class from an existing class or base class. The
base class is also known as parent class or super class .The new class that is formed is called
derived class. Derived class is also known as a child class or sub class. Inheritance helps in
reducing the overall code size of the program, which is an important concept in Object
Oriented Programming.
Data Abstraction
Data Encapsulation combines data and functions into single unit called class. When using
Data Encapsulation, data is not accessed directly; it is only accessible through the functions
present inside the class. Data Encapsulation enables the important concepts of data hiding.
Polymorphism
Reusability
This term refers to the ability for multiple programmers to use the same written and
debugged existing class of data .This is time-saving device and adds code efficiency to the
language. Additionally, the programmer can incorporate new features to the existing class,
further developing the application and allowing users to achieve increased performance.
This time-saving feature optimizes code, helps in gaining secured applications and
facilitates easier maintenance of the application.
HEADER FILE USED AND THEIR PURPOSE
conio.h
for clrscr() and getch() function
fstream.h
for file handling, cin and cout
iomanip.h
for setprecision() and setw() function
stdio.h
for standard I/O operation
DESCRIPTION OF PROGRAM
This program on student report card management is made using the basic
concepts of c++ like class, structure,loops,array,data file handling etc………..
The features of this program are:
1: Entry/edit menu:
Consists of separate column for entering the data, editing the data and even
deleting the record of the student.
2. Result menu:
A tabular column for viewing the entire results of each and every student and
comparing it (roll wise).
class student()
void student::calculate()
void student::getdata()
void student::show_tabular() const
#include<fstream.h>
#include<iomanip.h>
#include<stdio.h>
#include<conio.h>
class student
int rollno;
char name[50];
float per;
char grade;
public:
int retrollno();
};
void student::calculate()
per=(p_marks+c_marks+m_marks+e_marks+cs_marks)/5.0;
if(per>=60)
grade='A'; else if(per>=50) grade='B';
else if(per>=33)
grade='C';
else
grade='F';
void student::getdata()
cin>>rollno;
gets(name);
cin>>p_marks;
cin>>c_marks;
cin>>m_marks;
cin>>e_marks;
cin>>cs_marks;
calculate();
}
void student::showdata()
void student::show_tabular()
cout<<rollno<<setw(6)<<"
"<<name<<setw(10)<<p_marks<<setw(4)<<c_marks<<setw(4)
<<m_marks<<setw(4)<<e_marks<<setw(4)<<cs_marks<<setw(6)<<per<<setw(6)
<<" "<<grade<<endl;
int student::retrollno()
return rollno;
void write_student(); //write the record in binary file void display_all(); //read
all records from binary file
void display_sp(int); //accept rollno and read record from binary file
int main()
char ch;
cout.setf(ios::fixed|ios::showpoint);
clrscr();
intro();
do
clrscr();
cin>>ch;
clrscr();
switch(ch)
break;
case '2': entry_menu();
break;
case '3':
break;
default :cout<<"\a";
}while(ch!='3');
return 0;
void write_student()
student st;
ofstream outFile;
outFile.open("student.dat",ios::binary|ios::app);
st.getdata();
outFile.close();
cin.ignore();
getch();
void display_all()
student st;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
getch();
return;
st.showdata();
cout<<"\n\n====================================\n";
inFile.close();
getch();
void display_sp(int n)
student st;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
int flag=0;
if(st.retrollno()==n)
st.showdata();
flag=1;
inFile.close();
if(flag==0)
getch();
void modify_student(int n)
int found=0;
student st;
fstream File;
File.open("student.dat",ios::binary|ios::in|ios::out);
if(!File)
getch();
return;
if(st.retrollno()==n)
st.showdata();
st.getdata();
int pos=(-1)*sizeof(st);
File.seekp(pos,ios::cur);
found=1;
File.close();
if(found==0)
getch();
}
void delete_student(int n)
student st;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
getch();
return;
ofstream outFile;
outFile.open("Temp.dat",ios::out);
inFile.seekg(0,ios::beg);
if(st.retrollno()!=n)
outFile.close();
inFile.close();
remove("student.dat");
rename("Temp.dat","student.dat");
getch();
void class_result()
student st;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
getch();
return;
cout<<"==========================================================\
n";
cout<<"==========================================================\
n";
{
st.show_tabular();
getch();
inFile.close();
void result()
char ch;
int rno;
cout<<"\n\n\n\tRESULT MENU";
cin>>ch;
clrscr();
switch(ch)
break;
cin>>rno;
display_sp(rno);
break;
case '3' :break;
default :cout<<"\a";
void intro()
cout<<"\n\n\n\t\t STUDENT";
cout<<"\n\n\t\tREPORT CARD";
cout<<"\n\n\t\t PROJECT";
cout<<"\n\n\n\tMADE BY : T.KANNAN\n";
cout<<"\n\n\tR.NO:17";
getch();
void entry_menu()
char ch;
int num;
clrscr();
cout<<"\n\n\n\tENTRY MENU";
cin>>ch;
clrscr();
switch(ch)
case '1':write_student();
break;
case '2':display_all();
break;
cin>>num;
display_sp(num);
break;
cin>>num;
modify_student(num);
break;
cin>>num;
delete_student(num);
break;
case '6':break;
default:cout<<"\a";
entry_menu();
}
OUTPUT
HARDWARE REQUIRED
SOFTWARE REQUIRED
BOOKS:
Computer science with c++ by Sumita
Arora
INTERNET:
www.google.com
www.learncpp.com