001-What Is Object Oriented Programming
001-What Is Object Oriented Programming
Programming with
C++
What is Object Oriented
Programming?
What is Object Oriented
Programming
• Object Oriented Programming (OOP) is a programming paradigm based on
the concept of objects.
• A programming paradigm: is a style of programming, a way of thinking about
software construction.
• A programming paradigm does not refer to a specific language but rather to a
way to build a program or a methodology to apply.
• Some languages make it easy to write in some paradigms bot not others.
• Some programming languages allow the programmer to apply more than one
paradigm.
• programming languages that support OOP: C++, C#, Python, Java, and others.
2
What is object Oriented
Programming
• The programming paradigm refers to a way of conceptualizing and
structuring the tasks a computer performs.
Paradigm Languages Description
Procedural BASIC, Pascal, COBOL, Fortran, Ada Emphasizes linear steps that provide the computer with
instructions on how to solve a problem or carry out a
task.
Object oriented SmallTalk, C++, Java Formulates programs as s series of objects and methods
that interact to perform a specific task.
Declarative Prolog Focuses on the use of facts and rules to describe a
problem.
Functional LISP, Scheme, Haskell Emphasizes the evaluation of expressions, called
functions.
Event-Driven Visual Basic, C# Focuses on selecting user interface elements and defining
event-handling routines that are triggered by various
mouse or keyboard activities.
3
Example of Programming
Paradigm
• Procedural Programming: also known as inline programming tales a
top-down approach. It is about writing a list of instructions to tell the
computer what to do step by step. It relies on procedures (routines,
functions).
4
Example of Programming
Paradigm
• Procedural Programming - Program to calculate average of Array
items.
5
Object Oriented Programming
(OOP)
• Object Oriented Programming (OOP) is a programming paradigm
based on the concept of objects.
• Object: is a thing (Tangible or Intangible)
7
Object Oriented Programming
(OOP)
Objects in Super Market Program
8
Object is comprised of???
• Object has two components:
9
Object is comprised of???
• Object has two components:
1. Data items (attributes, properties , fields):
• information you want to store about the object.
• The set of attributes that describe the object.
10
Object is comprised of???
• Object has two components:
1. Data items (attributes, properties , fields)
2. Operations (behaviors, functions, actions , methods)
• What this object can do?
• What other can do with this object?
11
12
13
14