Professional Documents
Culture Documents
Names Roll-No
Arslan Ali F21-0541
Haroon Afzal F21-0550
Hamza Aslam F21-0551
Awais Noman F21-0556
Nabeel Khan F21-0560
Student Report Card
In CPP
Report Card
Store
in
File
Delet
Displa e
y All Recor
d
Search
Record
Structure Of Program
Line 11 – 14:
We use Header Files
#include<iostream> Input Output Stream Is Used For Input Output
Operation.
#include<iomanip> Input Output Manipulators Is Used To Manipulate The
Ouput Of C++ Program.
#include<fstream> File Stream Refers To A Sequence Of Characters
Moving From The Disk To C++ Program Or From The C++ Program To The
Disk.
#include<string> This Header File Is Required For String Function
Structure Of Program
Line 16 – 66
Here we create a class named as Student_report_card. In Class
definition we use public access specifier so that data members and
functions are accessible from anywhere in the program
Structure Of Program
Line 26 – 66
Then We Defined Following Function
Take_data() To Take The Data Of Students
Calculate() To Find The Total Marks And Average Of Student
Display() To Display The Data Of Students
Arrange() To Arrange The Data Of Student By Using Setwidth Function
Return_roll() To Return The Roll Number Of The Student For Searching
And Deleting Record From The File
Structure Of Program
Line 73-82
Then we declare some function
void write_student();
void display_all();
void search_std_data();
void delete_info();
void delete_student();
void intro();
void entry_menu();
Structure Of Program
Line 87-92
From Here Our Main Function Start In Main() Function We Call Two
Functions Intro() And entry_menu().
Structure Of Program
Line 98-111
Here We Define The Function Write_student In Which We Create An
Object Of Class Student_report_card Named As obj Then We Use
ofstream For Writing A File And In This We Call The Function Take_data
From Object obj To Take Data From User And Store Them In File
Structure Of Program
Line 119-140
Here We Define The Display_all Function To Display All The Data From
File For This We Use ifstream For Reading From File And Then We Call
arrange() Function To Display The Data In Proper Sequence
Structure Of Program
Line 148-178
Here We Define The Function Search_std_data() For This We Take Roll
Number Of The Student From User And Search That Roll Number In
File .If Roll Number Found In Files Then Display That Roll Number Data
Else Display Message Record Not Found.
Structure Of Program
Line 186-215
Here We Define The Function delete_student() For This We Take Roll Number
Of The Student From User And Search That Roll Number In File .Then We Just
Skip That Roll Number And Create Another File Named As Temp.Txt This File
Store All Other Roll Number
Studentinfo.txt
Studentinfo.txt Temp.txt
Student.txt
1 1
2 1 2
3 2 3
4 3 4
5 4
1
Structure Of Program
Line 223-239
Here We Define The Function Intro() This Will Appear On The Top Of
Program When We Execute The Program. This Program Contain Names Of
The Group Members
Structure Of Program
Line 246-282
Here We Define entry_menu() Function In This Function By Using Switch
Statement
We Give Some Options To User Like
1.CREATE STUDENT RECORD
2.DISPLAY ALL STUDENTS RECORDS
3.SEARCH STUDENT RECORD
4.DELETE STUDENT RECORD
5. PRESS 5 TO EXIT
And Ask User To Enter His/Her Choice And Call The Functions According To Users
Choice
Thank You