SlideShare a Scribd company logo
1 of 20
Basic Concepts of OOPs
Course Name:
Object Oriented
Programming with
C/C++
Course Code:
19008600
Computer Science
Engineering(Sem-III)
Faculty Name:
Zaiba Khan
Assistant Professor(CSE)
School of
Engineering &
Technology
Why do we need Object Oriented
Programming ?
 Object Oriented Programming was
developed because limitations were
discovered in earlier approaches to
programming.
Procedure Oriented Programming(POP)
 C, Pascal, Fortan and similar
languages are procedural languages.
 Each statement in the language tells
the computer to do something:
◦ Get some input
◦ Add these numbers
◦ Divide by 6
◦ Display that output
A program in a procedural language is a list
of instructions.
Procedure Oriented Programming(POP)
 Division into Functions:
◦ Procedural program is divided into
functions.
◦ Each function has clearly defined purpose
and a clearly defined interface to the other
functions in the program.
◦ It can be further extended by grouping a
number of functions together into a larger
entity called a module.
What are
functions?
Procedure Oriented Programming(POP)
 Division into functions:
Procedure Oriented Programming(POP)
 Characteristics:
◦ Emphasis is on doing things (Algorithms)
◦ Large programs are divided into smaller
programs known as functions.
◦ Most of the functions share global data.
◦ Functions transform data from one form to
another.
◦ Top-down approach is used in program
design.
What is Top-
down
approach?
Procedure Oriented Programming(POP)
 Top Down Approach:
◦ It is a process of breaking the overall
procedure or task into component parts
(modules) then subdivide each component
module until the lowest level of detail has
been reach.
◦ For Example: The payroll system of a
company can contain the following modules
or tasks
 Master file
 Earning
 Deductions
 Taxing
 Net Earning
 Print reports
Procedure Oriented Programming(POP)
 Drawbacks:
◦ Since every function has complete access
to the global variables, the new
programmer can corrupt the data accidently
by creating functions.
◦ We can access the data of one function from
other since, there is no protection.
◦ In large data program it is very difficult to
identify what data is used by which function.
◦ Similarly, if new data is to be added, all the
function needed to be modified to access the
data.
◦ It does not model with the real world problem
very well.
Object Oriented
Programming(OOP)
 OOP was introduced to overcome the
flaws in the procedural approach to
programming.
 Such as like reusability and
maintainability.
 The basic fundamental idea behind
OOP programming is to combine into
single unit both data and the functions
that operate on the data.
 Such unit is called Object.
Object Oriented
Programming(OOP)
 In OOP, problem is divided into the
number of entities called objects and
then builds data and functions around
these objects.
 Data of an object can be accessed
only by the functions associated with
that object.
 Communication of the objects done
through function.
Object Oriented Paradigm
Object Oriented
Programming(OOP)
 Characteristics:
◦ Emphasis more on data rather than
procedure.
◦ Programs are divided into entities called
object.
◦ Data is hidden and cannot be accessed by
external functions.
◦ Objects communicate with each through
functions.
◦ New data and functions can be easily added
whenever necessary .
◦ Follow bottom up design in program design.
Object Oriented
Programming(OOP)
 Bottom Up Approach:
◦ It is a reverse process of Top Down approach.
◦ Lower level task are carried out first and then
integrated to provide the solution of a single
program.
◦ Lower level structures of a program are evolved first.
◦ After that higher level structures are created.
◦ It promotes code reuse.
Summary:
Difference between POP & OOP
Procedural Oriented
Programming(POP)
 In POP, program is divided into
small parts called functions.
 In POP, Importance is not given to
data but to functions as well as
sequence of actions to be done.
 POP follows Top Down approach.
 POP does not have any access
specifier.
 In POP, Data can move freely from
function to function in the system.
 To add new data and function in
POP is not so easy.
 POP does not have any proper way
for hiding data so it is less secure.
 Example of POP are : C, VB,
FORTRAN, Pascal.
Object Oriented Programming(OOP)
 OOP, program is divided into parts
called objects.
 In OOP, Importance is given to the
data rather than procedures or
functions because it works as a real
world.
 OOP follows Bottom Up approach.
 OOP has access specifiers named
Public, Private, Protected, etc.
 In OOP, objects can move and
communicate with each other
through member functions.
 OOP provides an easy way to add
new data and function.
 OOP provides Data Hiding so
provides more security.
 Example of OOP are : C++, JAVA,
VB.NET, C#.NET.
Character Set in C++
 There are four types of Character Set:
Character Set
1.Ank Letters Uppercase A-Z
Lowercase a-z
2. Digits All digits 0-9
3. Special
Characters
All symbols , : ,
;,!, !,$, &,,*,%,@,
{},[],()
4. White Spaces Blank Space,
Horizontal tab,
New Line
Keywords in C++
Constant in C++
 It is an identifier whose value cannot be changed at the
execution time of program.
 It can simply be defined as “constant “ can be used to
represent as fixed values in a C++ program. Classification is
as follows:
Variables in C++
 Variables are used to store values.
 Variable name is the name of memory location where value is
store.
 It must be alphanumeric , only underscore is allowed in a
variable name.
Syntax:
Data-Type Variable Name
Examples:
int a;
float b;
char c;
Initialization of Variable:
Means assigning value to declared variable.
For example:
A= 10;
B=4.5;
C=‘a’;
Do You Know?
If no input
values are
assigned by the
user than
system will gives
a default value
called garbage
value.
Data Types in C++
 A keyword to identify type of data. It is used for storing the
input of the program into the main memory (RAM)of the
computer.
 There are three categories of data type. They are
Data Types in C++(Cont.)
 Primitive Data Types
◦ These are the data types whose variable can hold maximum one value at a time.
 Derived Data Types
◦ They are derived from fundamental data type.
◦ It allow us to store multiple values of same type in one variable BUT never allows to
store many values of different types.

More Related Content

What's hot

Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++Bhavik Vashi
 
C++ language basic
C++ language basicC++ language basic
C++ language basicWaqar Younis
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructorsNilesh Dalvi
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsNilesh Dalvi
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and DestructorKamal Acharya
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member FunctionsMuhammad Hammad Waseem
 
Constructor overloading & method overloading
Constructor overloading & method overloadingConstructor overloading & method overloading
Constructor overloading & method overloadinggarishma bhatia
 
Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Sameer Rathoud
 
C++ compilation process
C++ compilation processC++ compilation process
C++ compilation processRahul Jamwal
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPMudasir Qazi
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...Simplilearn
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams Ahmed Farag
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Vibhawa Nirmal
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member FunctionsMOHIT AGARWAL
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++Arpita Patel
 

What's hot (20)

Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
 
Constructor overloading & method overloading
Constructor overloading & method overloadingConstructor overloading & method overloading
Constructor overloading & method overloading
 
Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())
 
C++ compilation process
C++ compilation processC++ compilation process
C++ compilation process
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++
 

Similar to Oop in c++ lecture 1

Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - IntroductionMadishetty Prathibha
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programingAhammed Alamin
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programmingdkpawar
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++ shammi mehra
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionRai University
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionRai University
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
PCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docxPCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docxprakashvs7
 

Similar to Oop in c++ lecture 1 (20)

Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
chapter-6-oops.pdf
chapter-6-oops.pdfchapter-6-oops.pdf
chapter-6-oops.pdf
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programming
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
Abhiram
AbhiramAbhiram
Abhiram
 
C++ notes.pdf
C++ notes.pdfC++ notes.pdf
C++ notes.pdf
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
OOP ppt.pdf
OOP ppt.pdfOOP ppt.pdf
OOP ppt.pdf
 
Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
PCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docxPCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docx
 

Recently uploaded

School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 

Recently uploaded (20)

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

Oop in c++ lecture 1

  • 1. Basic Concepts of OOPs Course Name: Object Oriented Programming with C/C++ Course Code: 19008600 Computer Science Engineering(Sem-III) Faculty Name: Zaiba Khan Assistant Professor(CSE) School of Engineering & Technology
  • 2. Why do we need Object Oriented Programming ?  Object Oriented Programming was developed because limitations were discovered in earlier approaches to programming.
  • 3. Procedure Oriented Programming(POP)  C, Pascal, Fortan and similar languages are procedural languages.  Each statement in the language tells the computer to do something: ◦ Get some input ◦ Add these numbers ◦ Divide by 6 ◦ Display that output A program in a procedural language is a list of instructions.
  • 4. Procedure Oriented Programming(POP)  Division into Functions: ◦ Procedural program is divided into functions. ◦ Each function has clearly defined purpose and a clearly defined interface to the other functions in the program. ◦ It can be further extended by grouping a number of functions together into a larger entity called a module. What are functions?
  • 5. Procedure Oriented Programming(POP)  Division into functions:
  • 6. Procedure Oriented Programming(POP)  Characteristics: ◦ Emphasis is on doing things (Algorithms) ◦ Large programs are divided into smaller programs known as functions. ◦ Most of the functions share global data. ◦ Functions transform data from one form to another. ◦ Top-down approach is used in program design. What is Top- down approach?
  • 7. Procedure Oriented Programming(POP)  Top Down Approach: ◦ It is a process of breaking the overall procedure or task into component parts (modules) then subdivide each component module until the lowest level of detail has been reach. ◦ For Example: The payroll system of a company can contain the following modules or tasks  Master file  Earning  Deductions  Taxing  Net Earning  Print reports
  • 8. Procedure Oriented Programming(POP)  Drawbacks: ◦ Since every function has complete access to the global variables, the new programmer can corrupt the data accidently by creating functions. ◦ We can access the data of one function from other since, there is no protection. ◦ In large data program it is very difficult to identify what data is used by which function. ◦ Similarly, if new data is to be added, all the function needed to be modified to access the data. ◦ It does not model with the real world problem very well.
  • 9. Object Oriented Programming(OOP)  OOP was introduced to overcome the flaws in the procedural approach to programming.  Such as like reusability and maintainability.  The basic fundamental idea behind OOP programming is to combine into single unit both data and the functions that operate on the data.  Such unit is called Object.
  • 10. Object Oriented Programming(OOP)  In OOP, problem is divided into the number of entities called objects and then builds data and functions around these objects.  Data of an object can be accessed only by the functions associated with that object.  Communication of the objects done through function.
  • 12. Object Oriented Programming(OOP)  Characteristics: ◦ Emphasis more on data rather than procedure. ◦ Programs are divided into entities called object. ◦ Data is hidden and cannot be accessed by external functions. ◦ Objects communicate with each through functions. ◦ New data and functions can be easily added whenever necessary . ◦ Follow bottom up design in program design.
  • 13. Object Oriented Programming(OOP)  Bottom Up Approach: ◦ It is a reverse process of Top Down approach. ◦ Lower level task are carried out first and then integrated to provide the solution of a single program. ◦ Lower level structures of a program are evolved first. ◦ After that higher level structures are created. ◦ It promotes code reuse.
  • 14. Summary: Difference between POP & OOP Procedural Oriented Programming(POP)  In POP, program is divided into small parts called functions.  In POP, Importance is not given to data but to functions as well as sequence of actions to be done.  POP follows Top Down approach.  POP does not have any access specifier.  In POP, Data can move freely from function to function in the system.  To add new data and function in POP is not so easy.  POP does not have any proper way for hiding data so it is less secure.  Example of POP are : C, VB, FORTRAN, Pascal. Object Oriented Programming(OOP)  OOP, program is divided into parts called objects.  In OOP, Importance is given to the data rather than procedures or functions because it works as a real world.  OOP follows Bottom Up approach.  OOP has access specifiers named Public, Private, Protected, etc.  In OOP, objects can move and communicate with each other through member functions.  OOP provides an easy way to add new data and function.  OOP provides Data Hiding so provides more security.  Example of OOP are : C++, JAVA, VB.NET, C#.NET.
  • 15. Character Set in C++  There are four types of Character Set: Character Set 1.Ank Letters Uppercase A-Z Lowercase a-z 2. Digits All digits 0-9 3. Special Characters All symbols , : , ;,!, !,$, &,,*,%,@, {},[],() 4. White Spaces Blank Space, Horizontal tab, New Line
  • 17. Constant in C++  It is an identifier whose value cannot be changed at the execution time of program.  It can simply be defined as “constant “ can be used to represent as fixed values in a C++ program. Classification is as follows:
  • 18. Variables in C++  Variables are used to store values.  Variable name is the name of memory location where value is store.  It must be alphanumeric , only underscore is allowed in a variable name. Syntax: Data-Type Variable Name Examples: int a; float b; char c; Initialization of Variable: Means assigning value to declared variable. For example: A= 10; B=4.5; C=‘a’; Do You Know? If no input values are assigned by the user than system will gives a default value called garbage value.
  • 19. Data Types in C++  A keyword to identify type of data. It is used for storing the input of the program into the main memory (RAM)of the computer.  There are three categories of data type. They are
  • 20. Data Types in C++(Cont.)  Primitive Data Types ◦ These are the data types whose variable can hold maximum one value at a time.  Derived Data Types ◦ They are derived from fundamental data type. ◦ It allow us to store multiple values of same type in one variable BUT never allows to store many values of different types.

Editor's Notes

  1. Man is an intelligent specie, but still cannot perform all the task own its own. He rely on others. Like for food we rely on farmers, for groceries on food store. A computer find itself in the same situation. It cannot handle all the tasks own its own. In that case “Functions” are called Main() { Message(); } Message() { Printf{ “ Smile, and the world smiles with you”); }
  2. Top down approach which means that to solve a problem we first need to take a largest module and then it is solved so that small modules fit in that.
  3. If any single character (alphabet or numeric or special symbol) is enclosed between single quotes ' ' known as single character constant. If set of characters are enclosed between double quotes " " known as string character constant.