SlideShare a Scribd company logo
1 of 24
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 1
CSE III Year
Object Oriented
Programming with C++
Module-1
Concepts of
OOP
Mr. Aditya Tandon
8750006999
aditya.tandon@krishnacollege.ac.in
www.krishnacollege.ac.in
Concepts of OOP
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 2
• Introduction to OOP
• Procedural Vs. Object Oriented Programming
• Principles of OOP
• Benefits and applications of OOP
Introduction to OOP
 OOP is a design philosophy. It
Programming.
 C++ was founded in (1983)
stands for Object Oriented
Bjarne Stroustrup
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 3
Introduction to OOP
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 4
 Object-Oriented Programming (OOP) uses a different set of
programming languages than old procedural programming
languages like (C, Pascal, etc.).
 Everything in OOP is grouped as self sustainable "objects".
What is Object?
Pen
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 5
Board Laptop
Bench Student Projector
Physical objects…
What is Object?
Bank Account
Logical objects…
Result Account
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 6
Attributes and operations
Attributes:
Name
Age
Weight
Operations:
Eat
Sleep
Walk
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 7
Attributes:
Company
Model
Weight
Operations:
Drive
Stop
FillFuel
Attributes:
AccountNo
HolderName
Balance
Operations:
Deposit
Withdraw
Transfer
Write down 5 objects with their attributes and operations
What is Object ?
Properties (Describe)
Manufacturer
Model
Color
Year
Price
Methods (Actions)
Start
Drive
Park
Events
On_Start
On_Parked
On_Brake
OBJECT: CAR
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 8
Classes…
Class: Blueprint (template) for object.
Object: Instance of class.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 9
Class
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 10
Applications of OOP
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 11
 Real Time Systems Design
 Simulation and Modeling System
 Object Oriented Database
 Client-Server System
 Neural Networking and Parallel Programming
 Decision Support and Office Automation Systems
 CIM/CAD/CAM Systems
 AI and Expert Systems
Procedural Vs. Object Oriented Programming
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 12
POP OOP
Emphasis is on doing things not on
data, means it is function driven
Emphasis is on data rather than
procedure, means object driven
Main focus is on the function and
procedures that operate on data
Main focus is on the data that is
being operated
Top Down
design
approach in program Bottom Up approach in program
design
Large programs are divided into Large programs are divided into
smaller programs known as classes and objects
functions
Most of the functions share global
data
Data is tied together with function in
the data structure
Procedural Vs. Object Oriented Programming
POP OOP
Data moves openly in the system Data is hidden and cannot be
from one function to another accessed by external functions
function
Adding
difficult
of data and function is Adding of data and function is easy
We cannot declare namespace
directly
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 13
We can use name space directly,
Ex: using namespace std;
Concepts like inheritance,
polymorphism, data encapsulation,
abstraction, access specifiers are not
available.
Concepts like inheritance,
polymorphism, data encapsulation,
abstraction, access specifiers are
available and can be used easily
Examples: C, Fortran, Pascal, etc… Examples: C++, Java, C#, etc…
Principles of OOP (A.E.I.P)
 There are mainly four OOP Principles
Abstraction
Encapsulation
Inheritance
Polymorphism
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 14
Abstraction
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 15
 Abstraction refers to the act of representing essential features
without including the background details or explanations.
 Abstraction provides you a generalized view of your classes or
object by providing relevant information.
 Abstraction is the process of hiding the working style of an object,
and showing the information of an object in understandable
manner.
Abstraction Example
Nokia 1400
Features:
Nokia 2700
Features:
FM Radio
MP3
Camera
Blackberry
Features:
FM Radio
MP3
Camera
Video Recording
Reading E-mails
Abstract information (Necessary and
Common Information) for the object
“Mobile Phone” is make a call to any
number and can send SMS.”
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 16
Abstraction Example
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 17
 Example:
If somebody in your college tells you to fill application form,
you will fill your details like name, address, data of birth, which
semester, percentage you have got etc.
 If some doctor gives you an application to fill the details, you
will fill the details like name, address, date of birth, blood group,
height and weight.
 See in the above example what is the common thing?
Age, name, address so you can create the class which consist of
common thing that is called abstract class.
That class is not complete and it can inherit by other class.
Encapsulation
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 18
 The wrapping up of data and functions into a single unit is known
as encapsulation
 The insulation of the data from direct access by the program is
called data hiding or information hiding.
 It is the process of enclosing one or more details from outside
world through access right.
Encapsulation
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 19
• Abstraction is a process where you show
only “relevant” data and “hide”
unnecessary details of an object from the
user.
• Consider your mobile phone, you just
need to know what buttons are to be
pressed to send a message or make a call,
What happens when you press a button,
how your messages are sent, how your
calls are connected is all abstracted away
from the user.
• Encapsulation is the process of combining
data and functions into a single unit called
class. In Encapsulation, the data is not
accessed directly; it is accessed through
the functions present inside the class.
• Users are unaware about working of
circuitry and hardware devices.
Abstraction Vs Encapsulation
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 20
 Abstraction says what details to be made visible & Encapsulation
provides the level of access right to that visible details.
Example:
 When we switch on the Bluetooth, we are able to connect another
mobile but unable to access the other mobile features like dialling
a number, accessing inbox etc. This is because, Bluetooth feature
is given some level of abstraction.
Abstraction Vs Encapsulation
 When mobile A is connected with mobile B via Bluetooth whereas
mobile B is already connected to mobile C then A is not allowed to
connect C via B. This is because of accessibility restriction.
B
A
C
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 21
Inheritance
 Inheritance is the process by which objects of one class acquire
the properties of objects of another class.
 Here Vehicle class can have properties like Chassis no. , Engine,
Colour etc.
 All these properties inherited by sub classes of vehicle class.
Vehicle
Water
Land Air
Bus Car Ship Boat Aero plane Helicopter
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 22
Polymorphism
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 23
 Polymorphism means ability to take more than one form.
 For example the operation addition.
 For two numbers the operation will generate a sum.
 If the operands are strings, then the operation would produce a
third string by concatenation.
Thank You
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 24

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

cppoopsmodule1-210626081051.pptx

  • 1. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 1 CSE III Year Object Oriented Programming with C++ Module-1 Concepts of OOP Mr. Aditya Tandon 8750006999 aditya.tandon@krishnacollege.ac.in www.krishnacollege.ac.in
  • 2. Concepts of OOP Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 2 • Introduction to OOP • Procedural Vs. Object Oriented Programming • Principles of OOP • Benefits and applications of OOP
  • 3. Introduction to OOP  OOP is a design philosophy. It Programming.  C++ was founded in (1983) stands for Object Oriented Bjarne Stroustrup Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 3
  • 4. Introduction to OOP Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 4  Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages like (C, Pascal, etc.).  Everything in OOP is grouped as self sustainable "objects".
  • 5. What is Object? Pen Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 5 Board Laptop Bench Student Projector Physical objects…
  • 6. What is Object? Bank Account Logical objects… Result Account Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 6
  • 7. Attributes and operations Attributes: Name Age Weight Operations: Eat Sleep Walk Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 7 Attributes: Company Model Weight Operations: Drive Stop FillFuel Attributes: AccountNo HolderName Balance Operations: Deposit Withdraw Transfer Write down 5 objects with their attributes and operations
  • 8. What is Object ? Properties (Describe) Manufacturer Model Color Year Price Methods (Actions) Start Drive Park Events On_Start On_Parked On_Brake OBJECT: CAR Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 8
  • 9. Classes… Class: Blueprint (template) for object. Object: Instance of class. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 9
  • 10. Class Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 10
  • 11. Applications of OOP Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 11  Real Time Systems Design  Simulation and Modeling System  Object Oriented Database  Client-Server System  Neural Networking and Parallel Programming  Decision Support and Office Automation Systems  CIM/CAD/CAM Systems  AI and Expert Systems
  • 12. Procedural Vs. Object Oriented Programming Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 12 POP OOP Emphasis is on doing things not on data, means it is function driven Emphasis is on data rather than procedure, means object driven Main focus is on the function and procedures that operate on data Main focus is on the data that is being operated Top Down design approach in program Bottom Up approach in program design Large programs are divided into Large programs are divided into smaller programs known as classes and objects functions Most of the functions share global data Data is tied together with function in the data structure
  • 13. Procedural Vs. Object Oriented Programming POP OOP Data moves openly in the system Data is hidden and cannot be from one function to another accessed by external functions function Adding difficult of data and function is Adding of data and function is easy We cannot declare namespace directly Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 13 We can use name space directly, Ex: using namespace std; Concepts like inheritance, polymorphism, data encapsulation, abstraction, access specifiers are not available. Concepts like inheritance, polymorphism, data encapsulation, abstraction, access specifiers are available and can be used easily Examples: C, Fortran, Pascal, etc… Examples: C++, Java, C#, etc…
  • 14. Principles of OOP (A.E.I.P)  There are mainly four OOP Principles Abstraction Encapsulation Inheritance Polymorphism Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 14
  • 15. Abstraction Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 15  Abstraction refers to the act of representing essential features without including the background details or explanations.  Abstraction provides you a generalized view of your classes or object by providing relevant information.  Abstraction is the process of hiding the working style of an object, and showing the information of an object in understandable manner.
  • 16. Abstraction Example Nokia 1400 Features: Nokia 2700 Features: FM Radio MP3 Camera Blackberry Features: FM Radio MP3 Camera Video Recording Reading E-mails Abstract information (Necessary and Common Information) for the object “Mobile Phone” is make a call to any number and can send SMS.” Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 16
  • 17. Abstraction Example Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 17  Example: If somebody in your college tells you to fill application form, you will fill your details like name, address, data of birth, which semester, percentage you have got etc.  If some doctor gives you an application to fill the details, you will fill the details like name, address, date of birth, blood group, height and weight.  See in the above example what is the common thing? Age, name, address so you can create the class which consist of common thing that is called abstract class. That class is not complete and it can inherit by other class.
  • 18. Encapsulation Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 18  The wrapping up of data and functions into a single unit is known as encapsulation  The insulation of the data from direct access by the program is called data hiding or information hiding.  It is the process of enclosing one or more details from outside world through access right.
  • 19. Encapsulation Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 19 • Abstraction is a process where you show only “relevant” data and “hide” unnecessary details of an object from the user. • Consider your mobile phone, you just need to know what buttons are to be pressed to send a message or make a call, What happens when you press a button, how your messages are sent, how your calls are connected is all abstracted away from the user. • Encapsulation is the process of combining data and functions into a single unit called class. In Encapsulation, the data is not accessed directly; it is accessed through the functions present inside the class. • Users are unaware about working of circuitry and hardware devices.
  • 20. Abstraction Vs Encapsulation Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 20  Abstraction says what details to be made visible & Encapsulation provides the level of access right to that visible details. Example:  When we switch on the Bluetooth, we are able to connect another mobile but unable to access the other mobile features like dialling a number, accessing inbox etc. This is because, Bluetooth feature is given some level of abstraction.
  • 21. Abstraction Vs Encapsulation  When mobile A is connected with mobile B via Bluetooth whereas mobile B is already connected to mobile C then A is not allowed to connect C via B. This is because of accessibility restriction. B A C Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 21
  • 22. Inheritance  Inheritance is the process by which objects of one class acquire the properties of objects of another class.  Here Vehicle class can have properties like Chassis no. , Engine, Colour etc.  All these properties inherited by sub classes of vehicle class. Vehicle Water Land Air Bus Car Ship Boat Aero plane Helicopter Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 22
  • 23. Polymorphism Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 23  Polymorphism means ability to take more than one form.  For example the operation addition.  For two numbers the operation will generate a sum.  If the operands are strings, then the operation would produce a third string by concatenation.
  • 24. Thank You Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 24