C++ session 1
OOP’s
Object Oriented Program
2
Introduction
Object oriented programming is a principle of design and development of programs using
modular approach.
It provides advantage in creation and development of software for real life applications.
We are going to learn Basic concept, Advantages, and Technologies used in Object
Oriented Programming.
Some of the Object oriented programming languages are c++ ,java, c# and so on.
3
 OOP was introduced to over come flaws in
the procedural approach to programming.
Such as lack of reusability and
maintainability.
 Fundamental idea behind object oriented
languages is to combine into a single unit
both data and the functions that operate on
that data. Such a unit is called an Object.
4
“
An Example to understand OOP
5
6
Non-object oriented programming
language Object Oriented programming
Language
Basic concept
▷ Objects
▷ Classes
▷ Data Encapsulation
▷ Inheritance
▷ Polymorphism
▷ Dynamic binding
▷ Message Passing
7
Objects
• Objects are basic building block for
designing programs.
• They may represent a person, a place
or any item that the program must be
handle.
• Every object must be the member of a
particular class
8
Classes
9
 Classes are user-defined data types and it behaves like built in types
of programming language.
 Object contains code and data which can be made user definite type
using class.
 Objects are variables of class.
 Once a class has been defined we can create any number of objects
for that class .
 A class is collection of objects of similar type.
10
• We can create object of class
using following syntax,
• syntax : class-name object-name;
• Here class name is class which is
already created. Object name is
any user defined name. for
example, if student is class,
• Example : Student Deepak, Pavan;
• In example Deepak and Pavan are
name of objects for class student.
We can create any number of
objects for class.
11
Encapsulation
12
 Data encapsulation combines data and functions
into a single unit called class. Data encapsulation
prevents direct access to data.
DATA
METHODS
Object
Data Encapsulation
Inheritance
13
In OOP, the concept of Inheritance provides the
idea of reusability.
This means that we can add additional features to
an existing class without modifying it.
Super class
Sub class 1 Sub class 2
14
15
Polymorphism
Polymorphism is a feature of object oriented
program programming where a function can
take multiple forms based on type of
arguments.
The ability of an operator and function to
take multiple forms is known as
polymorphism.
16
Dynamic binding
Binding is the process of connecting one program to
another. Dynamic binding means code associated with
procedure call is known only at the time of program
execution routine.
Message passing
17
In OOP, processing is done by sending message to
objects. A message for an object is request for
execution of procedure.
18
Analysis
19
Objects
Classes
Data Encapsulation
Inheritance
Polymorphism
Dynamic binding
Message Passing
20
21
Find more maps at slidescarnival.com/extra-free-resources-icons-and-maps 22
1. OVERVIEW of C++
C++
C++ is a statically typed, compiled, general-
purpose, case-sensitive, free-form
programming language that supports
procedural, object-oriented, and generic
programming.
C++ is regarded as a middle-level language, as
it comprises a combination of both high-level
and low-level language features.
23
Presentation design
24
▷ C++ was developed by Bjarne Stroustrup
starting in 1979 at Bell Labs in Murray Hill,
New Jersey, as an enhancement to the C
language and originally named C with
Classes but later it was renamed C++ in
1983.
▷ C++ is a superset of C, and that virtually any
legal C program is a legal C++ program.
Standard Libraries
25
▷ The core language giving all the building blocks
including variables, data types and iterals , etc.
▷ The C++ Standard Library giving a rich set of
functions manipulating files, strings, etc.
▷ The Standard Template Library (STL) giving a rich
set of methods manipulating data structures, etc.
Standard C++ consists of three important parts:
Learning C++
The purpose of learning a programming language is
to become a better programmer; that is, to become
more effective at designing and implementing new
systems and at maintaining old
ones.
C++ supports a variety of programming styles. You
can write in the style of Fortran, C, Smalltalk, etc., in
any language. Each style can achieve its aims
effectively while maintaining runtime and space
efficiency.
27
 Use of C++
C++ is used by hundreds of thousands of
programmers in essentially every application
domain.
C++ is being highly used to write device drivers and
other software that rely on direct
manipulation of hardware under real-time constraints.
C++ is widely used for teaching and research because
it is clean enough for successful
teaching of basic concepts.
Thanks!
28

c++session 1.pptx

  • 1.
  • 2.
  • 3.
    Introduction Object oriented programmingis a principle of design and development of programs using modular approach. It provides advantage in creation and development of software for real life applications. We are going to learn Basic concept, Advantages, and Technologies used in Object Oriented Programming. Some of the Object oriented programming languages are c++ ,java, c# and so on. 3
  • 4.
     OOP wasintroduced to over come flaws in the procedural approach to programming. Such as lack of reusability and maintainability.  Fundamental idea behind object oriented languages is to combine into a single unit both data and the functions that operate on that data. Such a unit is called an Object. 4
  • 5.
    “ An Example tounderstand OOP 5
  • 6.
    6 Non-object oriented programming languageObject Oriented programming Language
  • 7.
    Basic concept ▷ Objects ▷Classes ▷ Data Encapsulation ▷ Inheritance ▷ Polymorphism ▷ Dynamic binding ▷ Message Passing 7
  • 8.
    Objects • Objects arebasic building block for designing programs. • They may represent a person, a place or any item that the program must be handle. • Every object must be the member of a particular class 8
  • 9.
    Classes 9  Classes areuser-defined data types and it behaves like built in types of programming language.  Object contains code and data which can be made user definite type using class.  Objects are variables of class.  Once a class has been defined we can create any number of objects for that class .  A class is collection of objects of similar type.
  • 10.
    10 • We cancreate object of class using following syntax, • syntax : class-name object-name; • Here class name is class which is already created. Object name is any user defined name. for example, if student is class, • Example : Student Deepak, Pavan; • In example Deepak and Pavan are name of objects for class student. We can create any number of objects for class.
  • 11.
  • 12.
    Encapsulation 12  Data encapsulationcombines data and functions into a single unit called class. Data encapsulation prevents direct access to data. DATA METHODS Object Data Encapsulation
  • 13.
    Inheritance 13 In OOP, theconcept of Inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. Super class Sub class 1 Sub class 2
  • 14.
  • 15.
    15 Polymorphism Polymorphism is afeature of object oriented program programming where a function can take multiple forms based on type of arguments. The ability of an operator and function to take multiple forms is known as polymorphism.
  • 16.
    16 Dynamic binding Binding isthe process of connecting one program to another. Dynamic binding means code associated with procedure call is known only at the time of program execution routine.
  • 17.
    Message passing 17 In OOP,processing is done by sending message to objects. A message for an object is request for execution of procedure.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
    Find more mapsat slidescarnival.com/extra-free-resources-icons-and-maps 22 1. OVERVIEW of C++
  • 23.
    C++ C++ is astatically typed, compiled, general- purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. 23
  • 24.
    Presentation design 24 ▷ C++was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey, as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983. ▷ C++ is a superset of C, and that virtually any legal C program is a legal C++ program.
  • 25.
    Standard Libraries 25 ▷ Thecore language giving all the building blocks including variables, data types and iterals , etc. ▷ The C++ Standard Library giving a rich set of functions manipulating files, strings, etc. ▷ The Standard Template Library (STL) giving a rich set of methods manipulating data structures, etc. Standard C++ consists of three important parts:
  • 26.
    Learning C++ The purposeof learning a programming language is to become a better programmer; that is, to become more effective at designing and implementing new systems and at maintaining old ones. C++ supports a variety of programming styles. You can write in the style of Fortran, C, Smalltalk, etc., in any language. Each style can achieve its aims effectively while maintaining runtime and space efficiency.
  • 27.
    27  Use ofC++ C++ is used by hundreds of thousands of programmers in essentially every application domain. C++ is being highly used to write device drivers and other software that rely on direct manipulation of hardware under real-time constraints. C++ is widely used for teaching and research because it is clean enough for successful teaching of basic concepts.
  • 28.