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

OOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Objectdkpawar
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)Ritika Sharma
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming LanguageAhmad Idrees
 
Inheritance in oops
Inheritance in oopsInheritance in oops
Inheritance in oopsHirra Sultan
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructorsNilesh Dalvi
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Gajendra Singh Thakur
 
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
 
Polymorphism in Python
Polymorphism in Python Polymorphism in Python
Polymorphism in Python Home
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++Laxman Puri
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++Sujan Mia
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language Mohamed Loey
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingAshita Agrawal
 

What's hot (20)

OOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Object
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
Inheritance in oops
Inheritance in oopsInheritance in oops
Inheritance in oops
 
Inheritance and polymorphism
Inheritance and polymorphism   Inheritance and polymorphism
Inheritance and polymorphism
 
Function overloading
Function overloadingFunction overloading
Function overloading
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)
 
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())
 
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
 
Polymorphism in Python
Polymorphism in Python Polymorphism in Python
Polymorphism in Python
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
Cours c++
Cours c++Cours c++
Cours c++
 
Python programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphismPython programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphism
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented Programming
 

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

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

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.