SlideShare a Scribd company logo
1 of 17
CPP103
Object-Oriented Programming
Object-Oriented Programming
What is OOP?
• Object-oriented
programming (OOP) is a
computer programming
model that organizes
software design around
data, or objects, rather than
functions and logic.
Class
• Class is comparable to an object’s
blueprint.
Objects
• Object is an element (or
instance) of a class; objects
have the behaviors of their
class.
Four (4) pillars of OOP
Encapsulation
• Encapsulation means containing all
important information inside an
object, and only exposing selected
information to the outside world. This
principle hides the internal software
code implementation inside a class
and hides internal data inside of
objects. Encapsulation requires
defining some fields as private or
public.
Abstraction
• Abstraction means that the user
only interacts with selected
attributes and methods of an
object. It uses simple things to
represent complexity, the main goal
is to hide complexity details from
the user.
Inheritance
• Inheritance is one of the most
important aspects of OOP. It allows
classes to inherit features of other
classes. Put another way, parent
classes extend attributes and
behaviors to child
classes. Inheritance supports
reusability.
Polymorphism
• Polymorphism literally means “many
forms”. This principle focuses on
designing objects to share behaviors.
Building from inheritance,
polymorphism allows the same
method to execute different
behaviors in two ways: method
overriding and method overloading.
Advantages of OOP
1. Enables code reusability
• The idea of inheritance is one of the critical concepts
offered by object-oriented programming. A class’s
attributes can be passed down through inheritance,
eliminating the need for duplication of effort. Doing this
prevents the problems associated with repeatedly writing
the same code.
2. Increases productivity in software
development
• We can create programs from pre-written, interconnected
modules rather than having to start from scratch, which
would save time and increase productivity. Thanks to the
OOP language, we can break the software into
manageable, discrete problems. Because it allows for the
division of labor in the creation of object-based programs,
object-oriented programming is modular.
3. Makes troubleshooting simpler
• When object-oriented programming is used,
troubleshooting is made simpler since the user knows
where to look in the code to find the source of the
problem. Since the error will indicate where the issue is,
there is no need to inspect additional code areas.
4. Reinforces security
• We can create programs from pre-written, interconnected
modules rather than having to start from scratch, which
would save time and increase productivity. Thanks to the
OOP language, we can break the software into
manageable, discrete problems. Because it allows for the
division of labor in the creation of object-based programs,
object-oriented programming is modular.
5. Provides design advantages
• A significant development in software engineering has
been object-oriented development. Among other things, it
promises to shorten development duration and give firms a
competitive advantage.
Lab. Activity 2
• Convert Activity 1 problem 9 to OOP paradigm

More Related Content

Similar to Lesson 1 - Object Oriented Programming CPP103.pptx

1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
Jay Patel
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
PadmaN24
 

Similar to Lesson 1 - Object Oriented Programming CPP103.pptx (20)

object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)
 
itft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in javaitft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in java
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptx
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
OOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdfOOPs-Interview-Questions.pdf
OOPs-Interview-Questions.pdf
 
Oop's
Oop'sOop's
Oop's
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
 
Diving into OOPs_ Key Concepts and Principles (1).pdf
Diving into OOPs_ Key Concepts and Principles (1).pdfDiving into OOPs_ Key Concepts and Principles (1).pdf
Diving into OOPs_ Key Concepts and Principles (1).pdf
 
DOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in cDOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in c
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Java object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - BrainsmartlabsJava object oriented programming concepts - Brainsmartlabs
Java object oriented programming concepts - Brainsmartlabs
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
130704798265658191
130704798265658191130704798265658191
130704798265658191
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 

Lesson 1 - Object Oriented Programming CPP103.pptx

  • 3. What is OOP? • Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic.
  • 4. Class • Class is comparable to an object’s blueprint.
  • 5. Objects • Object is an element (or instance) of a class; objects have the behaviors of their class.
  • 7. Encapsulation • Encapsulation means containing all important information inside an object, and only exposing selected information to the outside world. This principle hides the internal software code implementation inside a class and hides internal data inside of objects. Encapsulation requires defining some fields as private or public.
  • 8. Abstraction • Abstraction means that the user only interacts with selected attributes and methods of an object. It uses simple things to represent complexity, the main goal is to hide complexity details from the user.
  • 9. Inheritance • Inheritance is one of the most important aspects of OOP. It allows classes to inherit features of other classes. Put another way, parent classes extend attributes and behaviors to child classes. Inheritance supports reusability.
  • 10. Polymorphism • Polymorphism literally means “many forms”. This principle focuses on designing objects to share behaviors. Building from inheritance, polymorphism allows the same method to execute different behaviors in two ways: method overriding and method overloading.
  • 12. 1. Enables code reusability • The idea of inheritance is one of the critical concepts offered by object-oriented programming. A class’s attributes can be passed down through inheritance, eliminating the need for duplication of effort. Doing this prevents the problems associated with repeatedly writing the same code.
  • 13. 2. Increases productivity in software development • We can create programs from pre-written, interconnected modules rather than having to start from scratch, which would save time and increase productivity. Thanks to the OOP language, we can break the software into manageable, discrete problems. Because it allows for the division of labor in the creation of object-based programs, object-oriented programming is modular.
  • 14. 3. Makes troubleshooting simpler • When object-oriented programming is used, troubleshooting is made simpler since the user knows where to look in the code to find the source of the problem. Since the error will indicate where the issue is, there is no need to inspect additional code areas.
  • 15. 4. Reinforces security • We can create programs from pre-written, interconnected modules rather than having to start from scratch, which would save time and increase productivity. Thanks to the OOP language, we can break the software into manageable, discrete problems. Because it allows for the division of labor in the creation of object-based programs, object-oriented programming is modular.
  • 16. 5. Provides design advantages • A significant development in software engineering has been object-oriented development. Among other things, it promises to shorten development duration and give firms a competitive advantage.
  • 17. Lab. Activity 2 • Convert Activity 1 problem 9 to OOP paradigm