Student Report Card System Project in C++: A Comprehensive Guide, Study notes of Computer Science

12th Class Computer Science Study Notes

Typology: Study notes

2021/2022

Available from 08/29/2022

ali-ahmed-durrani
ali-ahmed-durrani 🇵🇰

47 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Student Report Card System Project in C++: A Comprehensive Guide and more Study notes Computer Science in PDF only on Docsity!

SESSION:-2018-

COMPUTER SCIENCE PROJECT

STD:-12TH^ Science

ROLL NO:-______

Submitted To: Submitted

By: Mr.Ali Ahmed.

during the year of2018-19 in partial fulfillment of computer science practical examination conducted by N.G International school, Mehsana. ________________ _______________ SIGNATURE OF EXTERNAL SIGNATURE OF INTERNAL EXAMINER EXAMINER _____________

Principal

INDEX

Sr.No Content Page

no.

1) Certificate of

Excellence

2) Acknowledgement 04

3) Introduction 05

4) Source Code 07

5) Output Window 26

6) Conclusion 35

7) Bibliography 36

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

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 edit the

report card record of a particular student.

5) Delete student record: This feature deletes the report card

record of a particular student

Header Files Used:

  1. #include

It is the predefined library function used for input and output

also called as header files. iostream is the header file which

contains all the functions of program like cout, cin etc. and

# include tells the preprocessor to include these header file in

the program. ... The file iostream is located in your include

path.

2) #include

File streams include two member functions specifically

designed to read and write binary data sequentially:

write and read. The first one (write) is a member function

of ostream (inherited by ofstream). And read is a

member function of instream (inherited by instream ).

Objects of class fstream have both. 3) #include

The header < iomanip > is part of the Input/output library of

the C++ Standard Library. It defines the manipulator

functions resetiosflags() , setiosflags() , setbase() , setfill() ,

setprecision() , and setw(). These functions may be

conveniently used by C++ programs to affect the state of

iostream objects.

Source code

#include #include #include using namespace std; class student {

else if(per>=60) grade='B'; else if(per>=50) grade='D'; else if(per>=40) grade='E'; else grade='F'; } void student::getdata() { cout<<"\nEnter The roll number of student "; cin>>rollno; cout<<"\n\nEnter The Name of student "; cin.ignore(); cin.getline(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();

int student::retrollno() const { return rollno; } void write_student(); //write void display_all(); //read void display_sp(int); //accept rolno and read record void modify_student(int); //accept rolno and update record OF FILE void delete_student(int); //accept rolno and delete selected records void class_result(); //display all records void result(); //display result void entry_menu(); //entry // THE MAIN FUNCTION OF PROGRAM int main() { char ch;

cout.setf(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): "; cin>>ch; switch(ch) { case '1': result(); break; case '2': entry_menu(); break; case '3':

student st; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n"; while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student))) { st.showdata(); cout<<"\n\n============================================ =======================\n"; } inFile.close(); cin.ignore(); cin.get();

// FILES TO READ SPECIFIC RECORDS FROM FILES

void display_sp(int n) { student st; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } bool flag=false; while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student))) { if(st.retrollno()==n)

cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } while(!File.eof() && found==false) { File.read(reinterpret_cast<char > (&st), sizeof(student)); if(st.retrollno()==n) { st.showdata(); cout<<"\n\nPlease Enter The New Details of student"<<endl; st.getdata(); intpos=(-1)static_cast(sizeof(st)); File.seekp(pos,ios::cur); File.write(reinterpret_cast<char *> (&st), sizeof(student)); cout<<"\n\n\t Record Updated";

found=true; } } File.close(); if(found==false) cout<<"\n\n Record Not Found "; cin.ignore(); cin.get(); } // FUNCTION TO DELETE RECORD OF FILE voiddelete_student(int n) { studentst; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return;