SlideShare a Scribd company logo
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 1
Mr. Aditya Tandon
8750006999
aditya.tandon@krishnacollege.ac.in
CSE III Year
Object Oriented
Programming with C++
Module-1
Concepts of
OOP
www.krishnacollege.ac.in
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 2
Concepts of OOP
• Introduction to OOP
• Procedural Vs. Object Oriented Programming
• Principles of OOP
• Benefits and applications of OOP
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 3
Introduction to OOP
 OOP is a design philosophy. It stands for Object Oriented
Programming.
 C++ was founded in (1983)
Bjarne Stroustrup
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 4
Introduction to OOP
 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".
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 5
What is Object?
Pen Board Laptop
Bench Student Projector
Physical objects…
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 6
What is Object?
Logical objects…
Result Account
Bank Account
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 7
Attributes and operations
Attributes:
Name
Age
Weight
Operations:
Eat
Sleep
Walk
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
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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 9
Classes…
Class: Blueprint (template) for object.
Object: Instance of class.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 10
Class
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 11
Applications of OOP
 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
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 12
Procedural Vs. Object Oriented Programming
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 approach in program
design
Bottom Up approach in program
design
Large programs are divided into
smaller programs known as
functions
Large programs are divided into
classes and objects
Most of the functions share global
data
Data is tied together with function in
the data structure
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 13
Procedural Vs. Object Oriented Programming
Data moves openly in the system
from one function to another
function
Data is hidden and cannot be
accessed by external functions
POP OOP
Adding of data and function is
difficult
Adding of data and function is easy
We cannot declare namespace
directly
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…
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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 15
Abstraction
 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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 17
Abstraction Example
 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 18
Encapsulation
 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 19
Encapsulation
• 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 20
Abstraction Vs Encapsulation
 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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 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 23
Polymorphism
 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.
Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 24
Thank You

More Related Content

What's hot

Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptxvijayapraba1
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Vibhawa Nirmal
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaAtul Sehdev
 
C++ decision making
C++ decision makingC++ decision making
C++ decision makingZohaib Ahmed
 
Control structures in c++
Control structures in c++Control structures in c++
Control structures in c++Nitin Jawla
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming languageMd.Al-imran Roton
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 
Strings in C language
Strings in C languageStrings in C language
Strings in C languageP M Patil
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVAAbhilash Nair
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programmingArchana Gopinath
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarSivakumar R D .
 

What's hot (20)

Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
 
Interface in java
Interface in javaInterface in java
Interface in java
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in java
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
 
Control structures in c++
Control structures in c++Control structures in c++
Control structures in c++
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Strings in C language
Strings in C languageStrings in C language
Strings in C language
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Complexity analysis in Algorithms
Complexity analysis in AlgorithmsComplexity analysis in Algorithms
Complexity analysis in Algorithms
 
Java operators
Java operatorsJava operators
Java operators
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programming
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.Sivakumar
 

Similar to OOPS with C++ | Concepts of OOPS | Introduction

Similar to OOPS with C++ | Concepts of OOPS | Introduction (20)

OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
OOP ppt.pdf
OOP ppt.pdfOOP ppt.pdf
OOP ppt.pdf
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
 
Object Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptxObject Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptx
 
Unit v(dsc++)
Unit v(dsc++)Unit v(dsc++)
Unit v(dsc++)
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
C++(introduction)
C++(introduction)C++(introduction)
C++(introduction)
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
1 intro
1 intro1 intro
1 intro
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 
22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf
 

Recently uploaded

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativePeter Windle
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxakshayaramakrishnan21
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...Nguyen Thanh Tu Collection
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfkaushalkr1407
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...Sayali Powar
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfVivekanand Anglo Vedic Academy
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxDenish Jangid
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resourcesdimpy50
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsCol Mukteshwar Prasad
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsparmarsneha2
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfjoachimlavalley1
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxssuserbdd3e8
 

Recently uploaded (20)

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 

OOPS with C++ | Concepts of OOPS | Introduction

  • 1. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 1 Mr. Aditya Tandon 8750006999 aditya.tandon@krishnacollege.ac.in CSE III Year Object Oriented Programming with C++ Module-1 Concepts of OOP www.krishnacollege.ac.in
  • 2. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 2 Concepts of OOP • Introduction to OOP • Procedural Vs. Object Oriented Programming • Principles of OOP • Benefits and applications of OOP
  • 3. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 3 Introduction to OOP  OOP is a design philosophy. It stands for Object Oriented Programming.  C++ was founded in (1983) Bjarne Stroustrup
  • 4. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 4 Introduction to OOP  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 5 What is Object? Pen Board Laptop Bench Student Projector Physical objects…
  • 6. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 6 What is Object? Logical objects… Result Account Bank Account
  • 7. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 7 Attributes and operations Attributes: Name Age Weight Operations: Eat Sleep Walk 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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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
  • 9. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 9 Classes… Class: Blueprint (template) for object. Object: Instance of class.
  • 10. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 10 Class
  • 11. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 11 Applications of OOP  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 12 Procedural Vs. Object Oriented Programming 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 approach in program design Bottom Up approach in program design Large programs are divided into smaller programs known as functions Large programs are divided into classes and objects Most of the functions share global data Data is tied together with function in the data structure
  • 13. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 13 Procedural Vs. Object Oriented Programming Data moves openly in the system from one function to another function Data is hidden and cannot be accessed by external functions POP OOP Adding of data and function is difficult Adding of data and function is easy We cannot declare namespace directly 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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 14 Principles of OOP (A.E.I.P)  There are mainly four OOP Principles Abstraction Encapsulation Inheritance Polymorphism
  • 15. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 15 Abstraction  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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.”
  • 17. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 17 Abstraction Example  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 18 Encapsulation  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 19 Encapsulation • 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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 20 Abstraction Vs Encapsulation  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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
  • 22. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 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
  • 23. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 23 Polymorphism  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. Module-1 Concepts of OOP Krishna Engineering College, Ghaziabad 24 Thank You

Editor's Notes

  1. Describe car Properties: Make, Model, Color, Year, Price Actions Start, Drive, Park Thing happens to a car Events On_Strart(Turn on head light),On_Parked, On_Brake These are backbone of object oriented programming
  2. 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. I am giving real life Example of Abstraction: Suppose you have an object Mobile Phone. Suppose you have 3 mobile phones as following Nokia 1400 (Features- Calling, SMS) Nokia 2700 (Features- Calling, SMS, FM Radio, MP3, Camera) Black Berry (Features- Calling, SMS, 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.” so that, for mobile phone object you will have abstract class like following:- view source code Abstraction means putting all the variables and methods in a class which are necessary. For example: – Abstract class and abstract method. Abstraction is the common thing. Example: If somebody in your collage tell 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