CH.
CHHABIL DASS PUBLIC
SCHOOL
SESSION:-2019-2020
COMPUTER SCIENCE PROJECT
Class:12THB
Submitted To: Submitted By:
[Link] Singhal Ashutosh Tripathi
Project based
On
Sports
Academy
Management
Tool
FUNCTIONS USED
1. Void getdata( ). //Used to get details of a member
[Link] putdata( ). //Used to enter details of a member
[Link] getid( ). //Used to get Id of a member
[Link] write_file( ). //Used to add a new member
[Link] read_file( ). //Used to read details of a member
[Link] Search ( ). //Used to search a member
[Link] modify( ). //Used to modify details of a member
[Link] delete1( ). //Used to delete details of a member
[Link] aboutus( ). //Tells about the academy
[Link] sports ( ) //Tells about the sports available
[Link] facilities ( ). //Tells about the facilities provided
[Link] Contactus( ). //Gives the contacting details
13. Void membership ( ). //Tells about the membership tenure
Certificate
RollNo: ExamNo:
This is to certify that Ashutosh Tripathi student of class
12thhas successfully completed the research on the below
mentioned project under the guidance of [Link] Singhal
during the year of 2019-20 in partial fulfillment of
computer science practical examination conducted by Ch.
Chhabil dass public school.
Signature of External Signature of Internal
Examiner Examiner
Principal
INDEX
[Link] Content
1) Certificate of
Excellence
2) Acknowledgement
3) Source Code
4) Output Window
5) Conclusion
6) Bibliography
Acknowledgement
In the accomplishment of this project successfully, many
people have best owned upon me their blessings and the
heart pledge support, this time I am utilizing to thank all
the people who have been concerned with this project.
Primarily I would like thank god for being able to
complete this project with success. Then I would like to
thank my principal [Link] Mawri and my Computer
science teacher Mr. Amit Singhal whose valuable
guidance has been the ones that helped me patch this
project and make it full proof success, his suggestions and
instruction has served as the major contribution towards
the completion of this project.
Then I would like to thank my parents who have helped
me with their valuable suggestions and guidance has been
very helpful in various phases of the completion of the
project.
INTRODUCTION
Student report card system project in C++ is a simple
consoleapplication built without the use of graphics. This
projectstudent report card system helps in managing the
record ofstudents according to their roll no. In this project we
tried toenter all details of students like roll no, name, marks in
all fivesubjects, etc. and tried to maintain all the possibility
which mayhelp the user to enter more record if he/she
requires. Some ofthe features of the program are:
1) Create student report card record: This feature createsa
new student record containing hismarks.
2) Read all students report card record: This features helps us
to read all records of student report card system project
present in the binary file of the in C++program.
3) Read specific student’s report card record: This feature is
same as the one explained above, except it shows the
progress report and relevant data related to a particular
student.
4) Modify student’s report card record: In student report
card system project in C++, this feature is used to editthe
report card record of a particularstudent.
5) Delete student record: This feature deletes the reportcard
record of a particularstudent
Page 5 of 36
Header Files Used:
1) #include<iostream>
It is the predefined library function used for input and
outputalso called as header files. iostream is the header file
whichcontains all the functions of program like cout, cin etc.
and#include tells the preprocessor to include these header
file intheprogram The file iostream is locatedin
your include path.
2) #include<fstream>
File streams include two member functions
specificallydesigned to read and write binary data
sequentially: writeand read. The first one (write) is a
member function ofostream (inherited by ofstream). And
read is a memberfunction of istream (inherited by
ifstream). Objects ofclass fstream have both.
3) #include<iomanip>
The header <iomanip> is part of the Input/output library
ofthe C++ Standard Library. It defines the
manipulatorfunctions resetiosflags() , setiosflags() ,
setbase() , setfill() ,setprecision() , and setw() . These
functions may beconveniently used by C++ programs to
affect the state ofiostream objects.
Page 6 of 36
Source code
#include<iostream>
#include<fstream>
#include<iomanip>
using namespace std;
class student
introllno;
char name[50];
intp_marks, c_marks, m_marks, e_marks,cs_marks;
doubleper;
chargrade;
void calculate(); // calculate grade
public:
voidgetdata(); //accept data
voidshowdata()const; //show data void
show_tabular()const;
Page 7 of 36
intretrollno() const;
};
void student::calculate()
per=(p_marks+c_marks+m_marks+e_marks+cs_marks)/5.0;
if(per>=90)
grade='A';
else if(per>=80&&per<90)
grade='B';
else if(per>=70)
grade='C';
elseif(per>=60)
grade='B';
elseif(per>=50)
grade='D';
elseif(per>=40)
grade='E';
else
grade='F';
Page 8 of 36
}
void student::getdata()
cout<<"\nEnter The roll number of student";
cin>>rollno;
cout<<"\n\nEnter The Name of student ";
[Link]();
[Link](name,50);
cout<<"\nEnter The marks in physics out of 100 :";
cin>>p_marks;
cout<<"\nEnter The marks in chemistry out of 100 :";
cin>>c_marks;
cout<<"\nEnter The marks in maths out of 100 : ";
cin>>m_marks;
cout<<"\nEnter The marks in english out of 100 : ";
cin>>e_marks;
cout<<"\nEnter The marks in computer science out of 100 : ";
cin>>cs_marks;
calculate();
Page 9 of 36
}
void student::showdata() const
cout<<"\nRoll number of student : "<<rollno;
cout<<"\nName of student : "<<name;
cout<<"\nMarks in Physics : "<<p_marks;
cout<<"\nMarks in Chemistry : "<<c_marks;
cout<<"\nMarks in Maths : "<<m_marks;
cout<<"\nMarks in English : "<<e_marks;
cout<<"\nMarks in Computer Science :"<<cs_marks;
cout<<"\nPercentage of student is :"<<per<<"%";
cout<<"\nGrade of student is :"<<grade;
void student::show_tabular() const
cout<<rollno<<setw(6)<<" \t
"<<name<<"\t"<<setw(10)<<p_marks<<setw(4)<<c_marks<<setw(4)<<
m_marks<<setw(4)
Page 10 of 36
<<e_marks<<setw(4)<<cs_marks<<setw(8)<<per<<setw(6)<<grad
e<<endl;
int student::retrollno() const
return rollno;
void write_student(); //write
voiddisplay_all(); //read
voiddisplay_sp(int); //accept rolno and readrecord
voidmodify_student(int); //accept rolno and update record OF FILE
voiddelete_student(int); //accept rolno and delete selectedrecords
voidclass_result(); //display allrecords
voidresult(); //displayresult
voidentry_menu(); //entry
Page 11 of 36
// THE MAIN FUNCTION OFPROGRAM
int main()
char ch;
[Link](ios::fixed|ios::showpoint);
cout<<setprecision(2); // program outputs decimal number to two
decimal places
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 : AKSHAT & VIREN";
cout<<"\n\tSCHOOL : N.G International SCHOOL";
do
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. RESULT MENU";
cout<<"\n\n\t02. ENTRY/EDIT MENU";
cout<<"\n\n\t03. EXIT";
cout<<"\n\n\tPlease Select Your Option (1-3): ";
Page 12 of 36
cin>>ch;
switch(ch)
case '1': result();
break;
case '2':entry_menu();
break;
case '3':
break;
default :cout<<"\a";
}while(ch!='3');
return 0;
}
// FUNCTION TO WRITE IN FILE
void write_student()
student st;
ofstreamoutFile;
[Link]("[Link]",ios::binary|ios::app);
Page 13 of 36
[Link]();
[Link](reinterpret_cast<char *> (&st), sizeof(student));
[Link]();
cout<<"\n\nStudent record Has Been Created ";
[Link]();
[Link]();
// FUNCTION TO READ ALL RECORDS FROMM FILE
void display_all()
student st;
ifstreaminFile;
[Link]("[Link]",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
[Link]();
[Link]();
return;
Page 14 of 36
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
while([Link](reinterpret_cast<char *> (&st), sizeof(student)))
{
[Link]();
cout<<"\n\n============================================
=======================\n";
[Link]();
[Link]();
[Link]();
// FILES TO READ SPECIFIC RECORDS FROM FILES
void display_sp(int n)
student st;
ifstreaminFile;
[Link]("[Link]",ios::binary);
if(!inFile)
Page 15 of 36
cout<<"File could not be open !! Press any Key...";
[Link]();
[Link]();
return;
bool flag=false;
while([Link](reinterpret_cast<char *> (&st), sizeof(student)))
if([Link]()==n)
[Link]();
flag=true;
[Link]();
if(flag==false)
cout<<"\n\nrecord not exist";
[Link]();
[Link]();
}
Page 16 of 36
// FUNCTION TO MODIFY RECORDS OF FILE
void modify_student(int n)
bool found=false;
student st;
fstream File;
[Link]("[Link]",ios::binary|ios::in|ios::out);
if(!File)
cout<<"File could not be open !! Press any Key...";
[Link]();
[Link]();
return;
}
while(![Link]() && found==false)
[Link](reinterpret_cast<char *> (&st), sizeof(student));
if([Link]()==n)
Page 17 of 36
{
[Link]();
cout<<"\n\nPlease Enter The New Details of
student"<<endl;
[Link]();
intpos=(-1)*static_cast<int>(sizeof(st));
[Link](pos,ios::cur);
[Link](reinterpret_cast<char *> (&st),
sizeof(student));
cout<<"\n\n\t Record Updated";
found=true;
[Link]();
if(found==false)
cout<<"\n\n Record Not Found ";
[Link]();
[Link]();
Page 18 of 36
// FUNCTION TO DELETE RECORD OF FILE
voiddelete_student(int n)
studentst;
ifstreaminFile;
[Link]("[Link]",ios::binary);
if(!inFile)
cout<<"File could not be open !! Press any Key...";
[Link]();
[Link]();
return;
}
ofstreamoutFile;
[Link]("[Link]",ios::out);
[Link](0,ios::beg);
while([Link](reinterpret_cast<char *> (&st), sizeof(student)))
if([Link]()!=n)
Page 19 of 36
[Link](reinterpret_cast<char *> (&st),
sizeof(student));
[Link]();
[Link]();
remove("[Link]");
rename("[Link]","[Link]");
cout<<"\n\n\tRecord Deleted ..";
[Link]();
//[Link]();
// FUNTION TO DISPLAY ALL STUDENT GRADEREPORT
voidclass_result()
studentst;
ifstreaminFile;
[Link]("[Link]",ios::binary);
if(!inFile)
Page 20 of 36
cout<<"File could not be open !! Press any Key...";
[Link]();
[Link]();
return;
cout<<"\n\n\t\tALL STUDENTS RESULT \n\n";
cout<<"===============================================
====================\n";
cout<<"[Link] Name P C M E CS %age
Grade"<<endl;
cout<<"===============================================
====================\n";
while([Link](reinterpret_cast<char *> (&st), sizeof(student)))
st.show_tabular();
[Link]();
//[Link]();
[Link]();
void result()
Page 21 of 36
{
charch;
intrno;
cout<<"\n\n\n\tRESULT MENU";
cout<<"\n\n\n\t1. Class Result";
cout<<"\n\n\t2. Student Report Card";
cout<<"\n\n\t3. Back to Main Menu";
cout<<"\n\n\n\tEnter Choice (1/2/3)? ";
cin>>ch;
switch(ch)
case'1': class_result();
break;
case '2' :class_result();
cout<<"===============================================
====================\n";
cout<<"\nChoose from the above list: "<<endl;
cout<<"\n\n\tEnter Roll Number Of Student : "; cin>>rno;
Page 22 of 36
display_sp(rno);
break;
case'3': break;
default: cout<<"\a";
}
}
// ENTRY / EDIT MENUFUNCTION
voidentry_menu()
charch;
intnum;
cout<<"\n\n\n\tENTRY MENU";
cout<<"\n\n\[Link] STUDENT RECORD";
cout<<"\n\n\[Link] ALL STUDENTS RECORDS";
cout<<"\n\n\[Link] STUDENT RECORD ";
cout<<"\n\n\[Link] STUDENT RECORD";
cout<<"\n\n\[Link] STUDENT RECORD";
cout<<"\n\n\[Link] TO MAIN MENU";
cout<<"\n\n\tPlease Enter Your Choice (1-6): ";
Page 23 of 36
cin>>ch;
switch(ch)
case'1': write_student();
break;
case'2': display_all();
break;
case'3': class_result();
cout<<"===============================================
====================\n";
cout<<"\nChoose from the above list: "<<endl;
cout<<"\n\n\tPlease Enter The roll number "; cin>>num;
display_sp(num);
break;
case'4': class_result();
cout<<"===============================================
====================\n";
cout<<"\nChoose from the above list: "<<endl;
cout<<"\n\n\tPlease Enter The roll number "; cin>>num;
modify_student(num);
Page 24 of 36
break;
case'5': class_result();
cout<<"===============================================
====================\n";
cout<<"\nChoose from the above list: "<<endl;
cout<<"\n\n\tPlease Enter The roll number "; cin>>num;
delete_student(num);
break;
case'6': break;
default: cout<<"\a";entry_menu();
Page 25 of 36
OUTPUT WINDOWS
OF THE
ABOVE PROGRAM
FROM THE MAIN MENU
Page 26 of 36
RESULT MENU
SELECTING THE OPTION CLASS RESULT (1.)
Page 27 of 36
SELECTING THE OPTION STUDENT REPORT
CARD(2.)
Page 28 of 36
IF YOU PRESS 3 THEN THE PROGRAMSWILL
RETURN TO MAIN MENU
From The Main MenuAgain
Page 29 of 36
SELECTING THE CREATE OPTION
Page 30 of 36
SELECTING THE DIPSPLAY OPTION
Page 31 of 36
SELECTING THE SEARCH OPTION
Page 32 of 36
SELECTING THE MODIFY OPTION
Page 33 of 36
SELECTING THE DELETE OPTION
After this if you press 3 then the programs getsexit
Page 34 of36
CONCLUSION
This software has its advantages and disadvantages but it
can surely help with the record storage system. We
don'thave to worry about the misplacing of record which
is agreat clash while storing the record on separate files.
Limitations
1) Does not supportmouse.
2) If some string is gives as input i.e. in place where integer
should have been input, the program crashes and datafile
getsspoiled.
3) This project can only work in particularsoftware
(CODEBLOCKS).
Bibliography
Sumita arora class 12.
Website--[Link]
[Link]
Thank you