SlideShare a Scribd company logo
1 of 9
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

Similar to Object oriented programming with c++.pptx

Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
James Wong
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Tony Nguyen
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Harry Potter
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Luis Goldster
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Young Alista
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Fraboni Ec
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
Kumar
 

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

24csharp
24csharp24csharp
24csharp
 
24c
24c24c
24c
 
12_oop templa.pptx
12_oop templa.pptx12_oop templa.pptx
12_oop templa.pptx
 
L1
L1L1
L1
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
 
Lec4
Lec4Lec4
Lec4
 
CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING
CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMINGCS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING
CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Computer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptxComputer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptx
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Software Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iSoftware Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-i
 
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 

More from TSha7

APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
TSha7
 
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptxCPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
TSha7
 

More from TSha7 (12)

Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
Lect 1b - Introduction to Pharmacy Informatics 1b.pdfLect 1b - Introduction to Pharmacy Informatics 1b.pdf
Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
 
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
Lect 1a - Introduction to Pharmacy Informatics 1a.pdfLect 1a - Introduction to Pharmacy Informatics 1a.pdf
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
 
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
 
bab 2 GEOGRAFI TINGKATAN TIGA MMALAYSIAA
bab 2 GEOGRAFI TINGKATAN TIGA MMALAYSIAAbab 2 GEOGRAFI TINGKATAN TIGA MMALAYSIAA
bab 2 GEOGRAFI TINGKATAN TIGA MMALAYSIAA
 
CHAPTER 2 cloud computing technology in cs
CHAPTER 2 cloud computing technology in csCHAPTER 2 cloud computing technology in cs
CHAPTER 2 cloud computing technology in cs
 
cloud computing chapter one in computer science
cloud computing chapter one in computer sciencecloud computing chapter one in computer science
cloud computing chapter one in computer science
 
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptxCPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
 
Process Synchronization scheduling .pptx
Process Synchronization scheduling .pptxProcess Synchronization scheduling .pptx
Process Synchronization scheduling .pptx
 
CHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptxCHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptx
 
CHAPTER 1 OBJECT ORIENTED NOTES SLIDE PRESENTATION
CHAPTER 1 OBJECT ORIENTED NOTES SLIDE PRESENTATIONCHAPTER 1 OBJECT ORIENTED NOTES SLIDE PRESENTATION
CHAPTER 1 OBJECT ORIENTED NOTES SLIDE PRESENTATION
 
GEO T3 KSSM Bab 1 Jadual dan Graf zila khalid =).pdf
GEO T3 KSSM Bab 1 Jadual dan Graf zila khalid =).pdfGEO T3 KSSM Bab 1 Jadual dan Graf zila khalid =).pdf
GEO T3 KSSM Bab 1 Jadual dan Graf zila khalid =).pdf
 
Oral_presentation_grading.pdf
Oral_presentation_grading.pdfOral_presentation_grading.pdf
Oral_presentation_grading.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Recently uploaded (20)

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 

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