SlideShare a Scribd company logo
1 of 73
Object Oriented Programming Department  of Computer Science, University of Peshawar Lecture 03 Introduction Introduction Lec - 03
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Abstraction ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Abstraction ,[object Object],[object Object],[object Object],Lecture 02 Introduction Department  of Computer Science, University of Peshawar Lecture 03 Introduction
Example - Abstraction ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example - Abstraction ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example - Abstraction ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example - Abstraction ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Abstraction - Advantage ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Class ,[object Object]
Example - Class ,[object Object],[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example - Class ,[object Object],[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Declaration of an Object class Rectangle { private:   int width;   int length; public:   void set(int w, int l);   int area(); } main() {   Rectangle r1; r1.set(5, 8);  } r1 is statically allocated width length r1 width = 5 length = 8 Lecture 03 Introduction
Difference Between Object And Class ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Difference Between Object And Class (continue) ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Inheritance ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Inheritance in classes ,[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example - Inheritance Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Teacher Student Doctor
Inheritance Concept Rectangle Triangle Polygon class Polygon { private:   int width, length; public:   void set(int w, int l); } class Rectangle{ private:   int width, length; public:   void set(int w, int l);   int area(); } class Triangle{ private:   int width, length; public:   void set(int w, int l);   int area(); } Lecture 03 Introduction
Inheritance Concept Rectangle Triangle Polygon class Polygon { protected:   int width, length; public:   void set(int w, int l); } class Rectangle : public Polygon { public:   int area(); } class Rectangle{ protected:   int width, length; public:   void set(int w, int l);   int area(); } Lecture 03 Introduction
Inheritance Concept Rectangle Triangle Polygon class Polygon { protected:   int width, length; public:   void set(int w, int l); } class Triangle : public Polygon { public: int area(); } class Triangle{ protected:   int width, length; public:   void set(int w, int l);   int area(); } Lecture 03 Introduction
Inheritance Concept Point Circle 3D-Point class Point { protected:   int x, y; public:   void set(int a, int b); } class Circle : public Point { private:  double r; } class 3D-Point: public Point { private:  int z; } x y x y r x y z Lecture 03 Introduction
[object Object],[object Object],Inheritance Concept RealNumber ComplexNumber ImaginaryNumber Rectangle Triangle Polygon Point Circle real imag real imag 3D-Point Lecture 03 Introduction
Inheritance – “IS A” or “IS A KIND OF” Relationship ,[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example – “IS A” Relatioship Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
Example – “IS A” Relatioship Lecture 03 Introduction Department  of Computer Science, University of Peshawar shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
Inheritance – Advantages ,[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Reuse with  Inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example Reuse Lecture 03 Introduction Department  of Computer Science, University of Peshawar Shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
Example – “IS A” Relatioship Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
Example – “IS A” Relatioship Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
Example Reuse Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
Concepts Related with Inheritance ,[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Generalization ,[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example Generalization Lecture 03 Introduction Department  of Computer Science, University of Peshawar Student Name Age gender Program Study_year Eat walk Study Heldexam Teacher Name age gender designation salary Eat walk Teach Take_exam Doctor Name Age gender designation salary Eat walk Check up prescribe
Example - Generalization Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
Sub-typing & Specialization ,[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example – Sub-typing (Extension) Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam
Specialization (Restriction) ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example – Specialization (Restriction) Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Age: [0…..100] Set Age(a) Adult Age: [18….100] Set Age(a) Age = a If age<18 Error Else Age = a
Example – Specialization (Restriction) Lecture 03 Introduction Department  of Computer Science, University of Peshawar integerSet ---------- Add ( element) Natural Set ------- Add ( element) Add element  To the set If element<1 Error Else Add element to the  set
Method Overriding ,[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
… Method Overriding.. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example – Specific Behavior Lecture 03 Introduction Department  of Computer Science, University of Peshawar shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
Example – Improve Performance Lecture 03 Introduction Department  of Computer Science, University of Peshawar Shape color coord draw Rotate Set color Circle redius Draw Rotate ,[object Object],[object Object],[object Object],[object Object],[object Object]
Abstract Classes ,[object Object],[object Object],[object Object],[object Object],Lecture 03 Introduction Department  of Computer Science, University of Peshawar
Example – Abstract Classes Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Teacher Doctor ,[object Object]
Concrete Classes ,[object Object],[object Object],[object Object],Lecture 03 Introduction
Example – Concrete Classes Lecture 03 Introduction Department  of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Teacher Doctor ,[object Object],Program Study Year Study Held Exam
Types of Inheritance ,[object Object],[object Object],[object Object],[object Object]
Types of Inheritance
Multiple Inheritance ,[object Object],[object Object]
Example – Multiple Inheritance
Example – Multiple Inheritance Land Vehicle Vehicle Water Vehicle Car Amphibious Vehicle Boot
Problems with multiple  Inheritance ,[object Object],[object Object],[object Object]
… Problems with multiple  Inheritance… ,[object Object],[object Object]
..Problems with multiple  Inheritance..
Solution – Override the common Feature ,[object Object],Land Vehicle Change Gear Water Vehicle Car Amphibious Vehicle Boot Vehicle
Composition – “has-a” relationship ,[object Object],[object Object],[object Object]
Example – Composition of Ali ,[object Object],[object Object],[object Object],[object Object],Head Ali Arms legs Head
Example – Composition of chair ,[object Object],[object Object],Lecture 03 Introduction Back Chair Arm seat Leg
Composition is Stronger ,[object Object],[object Object],[object Object],[object Object]
Example - Composition is Stronger ,[object Object],[object Object]
Example - Composition is Stronger ,[object Object],[object Object]
Aggregation ,[object Object],[object Object],[object Object]
Example – Aggregation ,[object Object],[object Object],[object Object],[object Object],Bed Room Chair Table Cupboard
Aggregation ,[object Object],[object Object]
Aggregation ,[object Object],[object Object],[object Object]
Aggregation is weaker ,[object Object],[object Object],[object Object],[object Object]
Example - Aggregation is weaker ,[object Object],[object Object]
Quizz (time-10 mins) ,[object Object],[object Object]
[object Object],Thanks Lecture 03 Introduction

More Related Content

Viewers also liked

The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelJane Garay
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
 
OOP programming
OOP programmingOOP programming
OOP programminganhdbh
 
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)Beat Signer
 
Object Oriented Programming - Introduction
Object Oriented Programming - IntroductionObject Oriented Programming - Introduction
Object Oriented Programming - IntroductionDudy Ali
 
Engineering kpi examples
Engineering kpi examplesEngineering kpi examples
Engineering kpi examplesgallaravumartin
 
The opportunity in computer science
The opportunity in computer scienceThe opportunity in computer science
The opportunity in computer scienceHadi Partovi
 
Seminar on 3 d internet
Seminar on 3 d internetSeminar on 3 d internet
Seminar on 3 d internetPabitra Padhy
 
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...Beat Signer
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?Colin Riley
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management systememailharmeet
 

Viewers also liked (20)

The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Software Basics
Software BasicsSoftware Basics
Software Basics
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
 
OOP programming
OOP programmingOOP programming
OOP programming
 
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
 
Unit 02 dbms
Unit 02 dbmsUnit 02 dbms
Unit 02 dbms
 
Database design
Database designDatabase design
Database design
 
Object Oriented Programming - Introduction
Object Oriented Programming - IntroductionObject Oriented Programming - Introduction
Object Oriented Programming - Introduction
 
Engineering kpi examples
Engineering kpi examplesEngineering kpi examples
Engineering kpi examples
 
The opportunity in computer science
The opportunity in computer scienceThe opportunity in computer science
The opportunity in computer science
 
10 Myths for Computer Science
10 Myths for Computer Science10 Myths for Computer Science
10 Myths for Computer Science
 
Seminar on 3 d internet
Seminar on 3 d internetSeminar on 3 d internet
Seminar on 3 d internet
 
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...
Extended ER Model and other Modelling Languages - Lecture 2 - Introduction to...
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Bhim app
Bhim appBhim app
Bhim app
 
What is OOP?
What is OOP?What is OOP?
What is OOP?
 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management system
 

Similar to Oop Introduction

Concept of Classes in c++.ist mse16.pptx
Concept of Classes in c++.ist mse16.pptxConcept of Classes in c++.ist mse16.pptx
Concept of Classes in c++.ist mse16.pptxsaadpisjes
 
OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabVicter Paul
 
Helping Students to Learn Matehmatics Beyond LMS
Helping Students to Learn Matehmatics Beyond LMSHelping Students to Learn Matehmatics Beyond LMS
Helping Students to Learn Matehmatics Beyond LMSMartin Homik
 
Ail apresentation(kumazawa)
Ail apresentation(kumazawa)Ail apresentation(kumazawa)
Ail apresentation(kumazawa)TakaKumazawa
 
Student self-assessment of the development of advanced scientific thinking sk...
Student self-assessment of the development of advanced scientific thinking sk...Student self-assessment of the development of advanced scientific thinking sk...
Student self-assessment of the development of advanced scientific thinking sk...Kirsten Zimbardi
 
Ibdp physics exetended essay and army ppt.pptx
Ibdp physics exetended essay and army ppt.pptxIbdp physics exetended essay and army ppt.pptx
Ibdp physics exetended essay and army ppt.pptxAarti Akela
 
Core java complete notes - PAID call at +91-814-614-5674
Core java complete notes - PAID call at +91-814-614-5674Core java complete notes - PAID call at +91-814-614-5674
Core java complete notes - PAID call at +91-814-614-5674WebKrit Infocom
 
eLearning in practice in Higher Education by Prof. Edward Reeve
eLearning in practice in Higher Education by Prof. Edward ReeveeLearning in practice in Higher Education by Prof. Edward Reeve
eLearning in practice in Higher Education by Prof. Edward ReeveDr Poonsri Vate-U-Lan
 
Java căn bản - Chapter13
Java căn bản - Chapter13Java căn bản - Chapter13
Java căn bản - Chapter13Vince Vo
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismEduardo Bergavera
 
Wi13 Workshop - Teaching as Research
Wi13 Workshop - Teaching as ResearchWi13 Workshop - Teaching as Research
Wi13 Workshop - Teaching as ResearchPeter Newbury
 
Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1PRN USM
 
Technology Integration
Technology IntegrationTechnology Integration
Technology Integrationjjaffe
 
Light structural systems_for_covering_large_spans
Light structural systems_for_covering_large_spansLight structural systems_for_covering_large_spans
Light structural systems_for_covering_large_spansAditya Sanyal
 
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question GenerationDynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question Generationijtsrd
 

Similar to Oop Introduction (20)

Concept of Classes in c++.ist mse16.pptx
Concept of Classes in c++.ist mse16.pptxConcept of Classes in c++.ist mse16.pptx
Concept of Classes in c++.ist mse16.pptx
 
OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - Lab
 
Eclass Model
Eclass ModelEclass Model
Eclass Model
 
Helping Students to Learn Matehmatics Beyond LMS
Helping Students to Learn Matehmatics Beyond LMSHelping Students to Learn Matehmatics Beyond LMS
Helping Students to Learn Matehmatics Beyond LMS
 
Ail apresentation(kumazawa)
Ail apresentation(kumazawa)Ail apresentation(kumazawa)
Ail apresentation(kumazawa)
 
Student self-assessment of the development of advanced scientific thinking sk...
Student self-assessment of the development of advanced scientific thinking sk...Student self-assessment of the development of advanced scientific thinking sk...
Student self-assessment of the development of advanced scientific thinking sk...
 
Ibdp physics exetended essay and army ppt.pptx
Ibdp physics exetended essay and army ppt.pptxIbdp physics exetended essay and army ppt.pptx
Ibdp physics exetended essay and army ppt.pptx
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Core java complete notes - PAID call at +91-814-614-5674
Core java complete notes - PAID call at +91-814-614-5674Core java complete notes - PAID call at +91-814-614-5674
Core java complete notes - PAID call at +91-814-614-5674
 
CURRICULUM VITAE
CURRICULUM VITAECURRICULUM VITAE
CURRICULUM VITAE
 
eLearning in practice in Higher Education by Prof. Edward Reeve
eLearning in practice in Higher Education by Prof. Edward ReeveeLearning in practice in Higher Education by Prof. Edward Reeve
eLearning in practice in Higher Education by Prof. Edward Reeve
 
Java căn bản - Chapter13
Java căn bản - Chapter13Java căn bản - Chapter13
Java căn bản - Chapter13
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and Polymorphism
 
Wi13 Workshop - Teaching as Research
Wi13 Workshop - Teaching as ResearchWi13 Workshop - Teaching as Research
Wi13 Workshop - Teaching as Research
 
Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1
 
Technology Integration
Technology IntegrationTechnology Integration
Technology Integration
 
ICTERI-2021-seidametova.pdf
ICTERI-2021-seidametova.pdfICTERI-2021-seidametova.pdf
ICTERI-2021-seidametova.pdf
 
Light structural systems_for_covering_large_spans
Light structural systems_for_covering_large_spansLight structural systems_for_covering_large_spans
Light structural systems_for_covering_large_spans
 
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question GenerationDynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 

Recently uploaded

Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/siemaillard
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfmstarkes24
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Celine George
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the lifeNitinDeodare
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17Celine George
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17Celine George
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...Nguyen Thanh Tu Collection
 
ĐỀ 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...Nguyen Thanh Tu Collection
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 
Discover the Dark Web .pdf InfosecTrain
Discover the Dark Web .pdf  InfosecTrainDiscover the Dark Web .pdf  InfosecTrain
Discover the Dark Web .pdf InfosecTraininfosec train
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdfVikramadityaRaj
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxCeline George
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticspragatimahajan3
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45MysoreMuleSoftMeetup
 

Recently uploaded (20)

Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
ĐỀ 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...
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
Discover the Dark Web .pdf InfosecTrain
Discover the Dark Web .pdf  InfosecTrainDiscover the Dark Web .pdf  InfosecTrain
Discover the Dark Web .pdf InfosecTrain
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 

Oop Introduction

  • 1. Object Oriented Programming Department of Computer Science, University of Peshawar Lecture 03 Introduction Introduction Lec - 03
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Lecture 03 Introduction Department of Computer Science, University of Peshawar
  • 14. Declaration of an Object class Rectangle { private: int width; int length; public: void set(int w, int l); int area(); } main() { Rectangle r1; r1.set(5, 8); } r1 is statically allocated width length r1 width = 5 length = 8 Lecture 03 Introduction
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Example - Inheritance Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Teacher Student Doctor
  • 20. Inheritance Concept Rectangle Triangle Polygon class Polygon { private: int width, length; public: void set(int w, int l); } class Rectangle{ private: int width, length; public: void set(int w, int l); int area(); } class Triangle{ private: int width, length; public: void set(int w, int l); int area(); } Lecture 03 Introduction
  • 21. Inheritance Concept Rectangle Triangle Polygon class Polygon { protected: int width, length; public: void set(int w, int l); } class Rectangle : public Polygon { public: int area(); } class Rectangle{ protected: int width, length; public: void set(int w, int l); int area(); } Lecture 03 Introduction
  • 22. Inheritance Concept Rectangle Triangle Polygon class Polygon { protected: int width, length; public: void set(int w, int l); } class Triangle : public Polygon { public: int area(); } class Triangle{ protected: int width, length; public: void set(int w, int l); int area(); } Lecture 03 Introduction
  • 23. Inheritance Concept Point Circle 3D-Point class Point { protected: int x, y; public: void set(int a, int b); } class Circle : public Point { private: double r; } class 3D-Point: public Point { private: int z; } x y x y r x y z Lecture 03 Introduction
  • 24.
  • 25.
  • 26. Example – “IS A” Relatioship Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
  • 27. Example – “IS A” Relatioship Lecture 03 Introduction Department of Computer Science, University of Peshawar shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
  • 28.
  • 29.
  • 30. Example Reuse Lecture 03 Introduction Department of Computer Science, University of Peshawar Shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
  • 31. Example – “IS A” Relatioship Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
  • 32. Example – “IS A” Relatioship Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
  • 33. Example Reuse Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
  • 34.
  • 35.
  • 36. Example Generalization Lecture 03 Introduction Department of Computer Science, University of Peshawar Student Name Age gender Program Study_year Eat walk Study Heldexam Teacher Name age gender designation salary Eat walk Teach Take_exam Doctor Name Age gender designation salary Eat walk Check up prescribe
  • 37. Example - Generalization Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam Teacher designation salary Teach Take_exam Doctor designation salary Check up prescribe
  • 38.
  • 39. Example – Sub-typing (Extension) Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Name Age Gender Eat walk Student Program Study_year Study Heldexam
  • 40.
  • 41. Example – Specialization (Restriction) Lecture 03 Introduction Department of Computer Science, University of Peshawar Person Age: [0…..100] Set Age(a) Adult Age: [18….100] Set Age(a) Age = a If age<18 Error Else Age = a
  • 42. Example – Specialization (Restriction) Lecture 03 Introduction Department of Computer Science, University of Peshawar integerSet ---------- Add ( element) Natural Set ------- Add ( element) Add element To the set If element<1 Error Else Add element to the set
  • 43.
  • 44.
  • 45. Example – Specific Behavior Lecture 03 Introduction Department of Computer Science, University of Peshawar shape color coordinates Draw rotate Set color Circle radius draw Compute area Line length Draw Triangle angle Draw Compute area
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 53.
  • 54. Example – Multiple Inheritance
  • 55. Example – Multiple Inheritance Land Vehicle Vehicle Water Vehicle Car Amphibious Vehicle Boot
  • 56.
  • 57.
  • 58. ..Problems with multiple Inheritance..
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.