You are on page 1of 25

Group Members

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

A Typical Report Card Contain Student Name ,


Subject Marks ,Average And Total Marks Of The
Student.
What Our Program Will Do

This Program Will Take The Student Details As Input And


Store All Information In File Along With This Display
Information ,Delete Information And Search Information
Functions
Concept Used

 Classes And Object


 Members Functions
 Data Member (Attributes)
 Loops
 While Loop
 Do While Loop
 File Handling
 Pointer
 Decision Statements
 If Else
 Switch
Classes

It is a user-defined data type, which holds its own data


members and member functions, which can be accessed and
used by creating an instance of that class. A C++ class is like
a blueprint for an object..
Object

 An object is the instance of the class used to access the


data members and members functions of the class using
dot operator.
 Object is created by using class name followed by object
name.
Data Members

The variables which are declared in any class by using


any fundamental data types (like int, char, float etc.) are
known as Data Members.
Member Function

The functions which are declared either in private section or


public section are known as Member functions.
Loops

Do While Loop While Loop


A While Loop Evaluates The
 Sometime a programmer want Condition If The Condition
to execute the loop at least Evaluates To True, The Code
once for some reasons, so in Inside The While Loop Is Executed.
the case do while is used.
Decision Statement

If/else Statement  Switch Statement


 If condition is true if will execute The objective of switch statement
and if it is false block of else will is to check several possible
execute. constant values for an expression
and then execute those which
match the particular label or case
constant value.
File Handling

 File Handling In C++ Is A Mechanism To Store The Output Of A


Program In A File And Help To Perform Various Operation On It.
Files Help To Store These Data Permanently On A Storage Device.
Structure Of Program
Take
Inpu
t

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

You might also like