SlideShare a Scribd company logo
OBJECT ORIENTED
PROGRAMMING WITH C++
MODULE OUTLINE
• INTRODUCTION TO OOP
• OBJECT AND CLASSES
• CONSTRUCTORS
• ENCAPSULATION
MODULE OUTCOME
1. Students must be able to understand the fundamentals of OOP
2. Students must practically experience OOP with C++ programming language
LET’S REVISE C++
Source code Output
INTRODUCTION TO OOP
• Programming paradigm that uses objects as fundamental building blocks of a software
application
• Objects are instances of classes. A class is a blueprint or template that defines the structure and
behavior of objects. For instance,
Person
-Name
-Age
-StudentID
-Major
Studen
t
-Person is the base class with attributes name
and age.
-Student is the derived class (a subclass of
Person) and inherits the attributes name and
age from the base class. Additionally, it has its
specific attributes, such as studentID and major
How to build classes and objects in C++
Source code
Output
Exercise
Add the second Employee with the
following details
Name: Ammar
Company: AIMST University
Age: 39
What are Constructors
Example
Special type of method that is invoked
each time an object of a class is
created
There are two constructors
- Default constructor
- Parameterized constructor
The parameterized constructor allows
you to specify the values during object
creation.
What is Encapsulation
Example
Encapsulation is wrapping of data a single unit
called class
It involves hiding the internal details of a class and
providing controlled access to its members (data
and functions)
Make the data members (e.g., Name and Age)
private, so they cannot be directly accessed from
outside the class.
Provide public member functions (getters and
setters) to access and modify these private data
members
Output
HTTPS://QUIZIZZ.COM
/JOIN/QUIZ/6538796BE
8A673828C597DF3/ST
ART
THANK
YOU

More Related Content

DOC
C# by Zaheer Abbas Aghani
DOC
C# by Zaheer Abbas Aghani
PPTX
Lesson 13 object and class
PPTX
Object Oriented Programming Class and Objects
PPT
Oose unit 3 ppt
PPTX
OOP Presentation.pptx
PPTX
OOP Presentation.pptx
PPT
OOSE Unit 3 PPT.ppt
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
Lesson 13 object and class
Object Oriented Programming Class and Objects
Oose unit 3 ppt
OOP Presentation.pptx
OOP Presentation.pptx
OOSE Unit 3 PPT.ppt

Similar to Object oriented programming with c++.pptx (20)

PPTX
OOP Unit 2 - Classes and Object
PDF
OOPS_Lab_Manual - programs using C++ programming language
PPTX
PPTX
24csharp
PPTX
12_oop templa.pptx
PDF
L1
PPTX
Object oriented programming. (1).pptx
PPTX
oop.pptx
PPTX
introduction_OOP for the java courses [Autosaved].pptx
PPTX
CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING
PPTX
Python aplicado a Inteligencia artificial y machine learning. Dia 91.
PPTX
Object oriented programming
PPTX
Object oriented analysis
PPTX
Object oriented analysis
PPTX
Object oriented analysis
PPTX
Object oriented analysis
PPTX
Object oriented analysis
PPTX
Object oriented analysis
PPTX
Object oriented analysis
OOP Unit 2 - Classes and Object
OOPS_Lab_Manual - programs using C++ programming language
24csharp
12_oop templa.pptx
L1
Object oriented programming. (1).pptx
oop.pptx
introduction_OOP for the java courses [Autosaved].pptx
CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING
Python aplicado a Inteligencia artificial y machine learning. Dia 91.
Object oriented programming
Object oriented analysis
Object oriented analysis
Object oriented analysis
Object oriented analysis
Object oriented analysis
Object oriented analysis
Object oriented analysis
Ad

More from TSha7 (20)

PPTX
Computer_Graphics_Presentationa (1).pptx
PPTX
Guidelines and Examples.pptxGuidelines and Examples.pptx
PPTX
01-introduction-130924015121-phpapp02.pptx
PPTX
Core-Challenges-in-Supply-Chain-for-Minimising-Operational-Waste-in-the-Manuf...
PPTX
Computer-Graphics Fundamentals of Computer Graphics
PPTX
Fundamentalsss-of-Computer-Graphics.pptx
PPTX
electronicpaymentppt-140601022736-phpapp02.pptx
PPT
5-170401094214-1704010942145-170401094214.ppt
PDF
operating system in computer science .pdf
PDF
operating system in computer science ch05.pdf
PPTX
nursing researvh RESEARCH PROPOSAL SLIDE.pptx
PPTX
Streamlining Collaboration and Development - cloud computing .pptx
PPTX
CHAPTER 7 Legal Issues in E-Commerce: A Beginner's Guide
PPTX
CHAPTER 3 oop with programming java language
PPTX
CHAPTER 5 oop chapter 5 programming sem2
PPTX
CHAPTER 6 oop with c++ chapter programming
PDF
introduction to Python and Computer Programming.pdf
PDF
Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
PDF
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
PPTX
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
Computer_Graphics_Presentationa (1).pptx
Guidelines and Examples.pptxGuidelines and Examples.pptx
01-introduction-130924015121-phpapp02.pptx
Core-Challenges-in-Supply-Chain-for-Minimising-Operational-Waste-in-the-Manuf...
Computer-Graphics Fundamentals of Computer Graphics
Fundamentalsss-of-Computer-Graphics.pptx
electronicpaymentppt-140601022736-phpapp02.pptx
5-170401094214-1704010942145-170401094214.ppt
operating system in computer science .pdf
operating system in computer science ch05.pdf
nursing researvh RESEARCH PROPOSAL SLIDE.pptx
Streamlining Collaboration and Development - cloud computing .pptx
CHAPTER 7 Legal Issues in E-Commerce: A Beginner's Guide
CHAPTER 3 oop with programming java language
CHAPTER 5 oop chapter 5 programming sem2
CHAPTER 6 oop with c++ chapter programming
introduction to Python and Computer Programming.pdf
Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
Ad

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Cell Structure & Organelles in detailed.
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Pharma ospi slides which help in ospi learning
PDF
Basic Mud Logging Guide for educational purpose
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Structure & Organelles in detailed.
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
human mycosis Human fungal infections are called human mycosis..pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Week 4 Term 3 Study Techniques revisited.pptx
01-Introduction-to-Information-Management.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
VCE English Exam - Section C Student Revision Booklet
Pharma ospi slides which help in ospi learning
Basic Mud Logging Guide for educational purpose
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table

Object oriented programming with c++.pptx

  • 2. MODULE OUTLINE • INTRODUCTION TO OOP • OBJECT AND CLASSES • CONSTRUCTORS • ENCAPSULATION
  • 3. MODULE OUTCOME 1. Students must be able to understand the fundamentals of OOP 2. Students must practically experience OOP with C++ programming language
  • 5. INTRODUCTION TO OOP • Programming paradigm that uses objects as fundamental building blocks of a software application • Objects are instances of classes. A class is a blueprint or template that defines the structure and behavior of objects. For instance, Person -Name -Age -StudentID -Major Studen t -Person is the base class with attributes name and age. -Student is the derived class (a subclass of Person) and inherits the attributes name and age from the base class. Additionally, it has its specific attributes, such as studentID and major
  • 6. How to build classes and objects in C++ Source code Output Exercise Add the second Employee with the following details Name: Ammar Company: AIMST University Age: 39
  • 7. What are Constructors Example Special type of method that is invoked each time an object of a class is created There are two constructors - Default constructor - Parameterized constructor The parameterized constructor allows you to specify the values during object creation.
  • 8. What is Encapsulation Example Encapsulation is wrapping of data a single unit called class It involves hiding the internal details of a class and providing controlled access to its members (data and functions) Make the data members (e.g., Name and Age) private, so they cannot be directly accessed from outside the class. Provide public member functions (getters and setters) to access and modify these private data members Output