SlideShare uma empresa Scribd logo
1 de 55
Object-Oriented Programming(OOP) 1 PRANJAL SAINI (LECTURER) B.E.,M.TECH.,MBA
Paradigm Shift in Programming ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ALGORITHMS ,[object Object],[object Object],[object Object],[object Object],[object Object]
Understanding the Algorithm ,[object Object]
The most common block symbols are:
Problem for Flowchart ,[object Object],[object Object],[object Object]
A flowchart representation of the algorithm for the above problem can be as follows:
History of Object-Oriented Programming ,[object Object],[object Object],[object Object]
Object-Oriented Programming ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Oriented Languages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structured Programming Concept(Modular Prog.) ,[object Object],[object Object],[object Object],[object Object]
Cont…. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Procedural Programming  (Procedure oriented)  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Top down approach ,[object Object],[object Object],[object Object],[object Object]
Advantages of the Top-Down    Design Method •  It is easier to comprehend the solution of a smaller and less    complicated problem than to grasp the solution of a large and    complex problem. •  It is easier to test segments of solutions, rather than the    entire solution at once. This method allows one to test the    solution of each sub-problem separately until the entire solution has been tested. •  It is often possible to simplify the logical steps of each sub-   problem, so that when taken as a whole, the entire solution    has less complex logic and hence easier to develop. •  A simplified solution takes less time to develop and will be   more readable. •  The program will be easier to maintain.
Bottom up approach  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Concept of Class and Object ,[object Object],[object Object]
Structure of a Class in C++ class   name  { declarations constructor definition(s) method definitions } attributes and symbolic constants how to create and initialize objects how to manipulate the state of objects These parts of a class can actually be in any order
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Members of class ,[object Object]
Features of OOP  ,[object Object],[object Object],[object Object],[object Object]
Polymorphism  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Polymorphism World India China USA Rajasthan New delhi Washington New york
Inheritance  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Base class Flower Rose Rajasthan Jaipur World India Derived class Single level  Multi level  Multiple Base class Derived class Bird Parrot Sparrow
Class A { }; Class B:public A { }; Class C:public B { }; Class D: public C { };     Multi level Class A { }; Class B { }; Class C:public A, Public B { };   Multiple Class base { Data members and Functions; }; Class derived:public base { Data members and functions; }; Single Level
Hierarchical Inheritance A B C D E F I H G J
I Half(Hierarchical) II Half (Multiple ) Hybrid Hybrid = Hierarchical + Multiple Class D Class A Class B Class  C Hybrid = Multi level+ Multiple Class D Class B Class C Class A Class C Class B Class D Class B Class C Class A
Ex. of Inheritance RTU Engg. college ECE Deptt. EE Deptt. CS Deptt. Civil Deptt. Parent class Child class Sub classes of child class
PPP INHERITANCE  (CLASS MEMBERS) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Encapsulation Encapsulation is the mechanism that binds the data & function in one form known as  class. The data & function may be private or public.
Objects binds together in form of a Class… Animal Dog Cat Fish Mutt Poodle Gold Beta
[object Object],[object Object]
Why Reading Language C++ ? ,[object Object],[object Object],[object Object],[object Object]
Using C++ ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C++ Character set ,[object Object],[object Object],[object Object],[object Object],[object Object],ASCII Values
C++ Data types S. No DATA TYPE Size (in bytes) RANGE 1 Short int 2 -32768 to +32767 2 Unsigned short int 2 0 to 65535 3 long int 4 -2147483648 to 2147483647 4 Float 4 3.4e-38 to 3.4e+38 5 Char 1 -128 to 127 6 Unsigned char 1 0 to 255 7 Unsigned long int 4 0 to 4294967295 8 Double 8 1.7e-308 to 1.7e+308 9 Long double 10 1.7e-308 to 1.7e+308
C++ Tokens ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C++ Constants Non Numeric constants  Numeric  Constants Real Constants Integer Constants String Constants Character Constants Decimal, Octal, Hex
C++ Operators  S. No OPERATORS SYMBOLS 1. Arithmetic +,-,/,*,% 2. Logical &&,||,! 3. Relational <,>,>=,<=,==,!= 4. Assignment = 5. Increment ++ 6. Decrement -- 7. Comma , 8. Conditional (Ternary) ?: 9. Bitwise &,|,^,!,>>,<< 10. Special Operator Sizeof 11. Extraction >> 12. Insertion << 13. Dynamic Memory Allocator New 14. Dynamic memory De-allocator Delete
Some streams in <iostream.h> ,[object Object],[object Object],[object Object],[object Object],[object Object]
C  vs  C++  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Program  Hello ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Stream Input/Output Keyboard Console Unit INDIA INDIA Stream Input Stream Output
Program  Average ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Call by Reference  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Return by reference ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],i j Temporary storage 8 8 8
Matrix Multiplication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
cin>>row1; cout<<&quot;enter column for first matrix&quot;; cin>>col1; cout<<&quot;enter elements of first matrix&quot;; for(i=0;i<row1;i++) { for(j=0;j<col1;j++) { cin>>mat1[i][j]; } } cout<<&quot;enter the row of second matrix&quot;; cin>>row2; cout<<&quot;enter column for second matrix&quot;; cin>>col2; cout<<&quot;enter elements of second matrix&quot;;
for(i=0;i<row2;i++) { for(j=0;j<col2;j++) { cin>>mat2[i][j]; } } if(col1==row2) { cout<<&quot;multiplication of matrices is&quot;; for(i=0;i<row1;i++) { for(j=0;j<col1;j++) {
multi[i][j]=0; for(k=0;k<col1;k++) { multi[i][j]+=mat1[i][k]*mat2[k][j]; } cout<<multi[i][j]; }   cout<<endl; } } else cout<<&quot;multiplication is not compatible&quot;; getch(); }
Inline Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Overloading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
“ HAVE A NICE DAY”

Mais conteúdo relacionado

Mais procurados

Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programmingAbzetdin Adamov
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
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
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT03062679929
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
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
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPTAjay Chimmani
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 

Mais procurados (20)

[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Array in c++
Array in c++Array in c++
Array in c++
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 

Semelhante a OOP Concepts Explained: Classes, Objects, Inheritance and Polymorphism

Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)geetika goyal
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++KAUSHAL KUMAR JHA
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptxVijalJain3
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)Jay Patel
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.pptcitizen15
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsITNet
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptxPadmaN24
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++Amresh Raj
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperLee Greffin
 

Semelhante a OOP Concepts Explained: Classes, Objects, Inheritance and Polymorphism (20)

Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
UNIT1-JAVA.pptx
UNIT1-JAVA.pptxUNIT1-JAVA.pptx
UNIT1-JAVA.pptx
 
My c++
My c++My c++
My c++
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 

Último

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 

Último (20)

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 

OOP Concepts Explained: Classes, Objects, Inheritance and Polymorphism

  • 1. Object-Oriented Programming(OOP) 1 PRANJAL SAINI (LECTURER) B.E.,M.TECH.,MBA
  • 2.
  • 3.
  • 4.
  • 5. The most common block symbols are:
  • 6.
  • 7. A flowchart representation of the algorithm for the above problem can be as follows:
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Advantages of the Top-Down Design Method • It is easier to comprehend the solution of a smaller and less complicated problem than to grasp the solution of a large and complex problem. • It is easier to test segments of solutions, rather than the entire solution at once. This method allows one to test the solution of each sub-problem separately until the entire solution has been tested. • It is often possible to simplify the logical steps of each sub- problem, so that when taken as a whole, the entire solution has less complex logic and hence easier to develop. • A simplified solution takes less time to develop and will be more readable. • The program will be easier to maintain.
  • 16.
  • 17.
  • 18. Structure of a Class in C++ class name { declarations constructor definition(s) method definitions } attributes and symbolic constants how to create and initialize objects how to manipulate the state of objects These parts of a class can actually be in any order
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. Polymorphism World India China USA Rajasthan New delhi Washington New york
  • 24.
  • 25. Base class Flower Rose Rajasthan Jaipur World India Derived class Single level Multi level Multiple Base class Derived class Bird Parrot Sparrow
  • 26. Class A { }; Class B:public A { }; Class C:public B { }; Class D: public C { }; Multi level Class A { }; Class B { }; Class C:public A, Public B { }; Multiple Class base { Data members and Functions; }; Class derived:public base { Data members and functions; }; Single Level
  • 27. Hierarchical Inheritance A B C D E F I H G J
  • 28. I Half(Hierarchical) II Half (Multiple ) Hybrid Hybrid = Hierarchical + Multiple Class D Class A Class B Class C Hybrid = Multi level+ Multiple Class D Class B Class C Class A Class C Class B Class D Class B Class C Class A
  • 29. Ex. of Inheritance RTU Engg. college ECE Deptt. EE Deptt. CS Deptt. Civil Deptt. Parent class Child class Sub classes of child class
  • 30.
  • 31. Encapsulation Encapsulation is the mechanism that binds the data & function in one form known as class. The data & function may be private or public.
  • 32. Objects binds together in form of a Class… Animal Dog Cat Fish Mutt Poodle Gold Beta
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. C++ Data types S. No DATA TYPE Size (in bytes) RANGE 1 Short int 2 -32768 to +32767 2 Unsigned short int 2 0 to 65535 3 long int 4 -2147483648 to 2147483647 4 Float 4 3.4e-38 to 3.4e+38 5 Char 1 -128 to 127 6 Unsigned char 1 0 to 255 7 Unsigned long int 4 0 to 4294967295 8 Double 8 1.7e-308 to 1.7e+308 9 Long double 10 1.7e-308 to 1.7e+308
  • 38.
  • 39. C++ Constants Non Numeric constants Numeric Constants Real Constants Integer Constants String Constants Character Constants Decimal, Octal, Hex
  • 40. C++ Operators S. No OPERATORS SYMBOLS 1. Arithmetic +,-,/,*,% 2. Logical &&,||,! 3. Relational <,>,>=,<=,==,!= 4. Assignment = 5. Increment ++ 6. Decrement -- 7. Comma , 8. Conditional (Ternary) ?: 9. Bitwise &,|,^,!,>>,<< 10. Special Operator Sizeof 11. Extraction >> 12. Insertion << 13. Dynamic Memory Allocator New 14. Dynamic memory De-allocator Delete
  • 41.
  • 42.
  • 43.
  • 44. Stream Input/Output Keyboard Console Unit INDIA INDIA Stream Input Stream Output
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. cin>>row1; cout<<&quot;enter column for first matrix&quot;; cin>>col1; cout<<&quot;enter elements of first matrix&quot;; for(i=0;i<row1;i++) { for(j=0;j<col1;j++) { cin>>mat1[i][j]; } } cout<<&quot;enter the row of second matrix&quot;; cin>>row2; cout<<&quot;enter column for second matrix&quot;; cin>>col2; cout<<&quot;enter elements of second matrix&quot;;
  • 51. for(i=0;i<row2;i++) { for(j=0;j<col2;j++) { cin>>mat2[i][j]; } } if(col1==row2) { cout<<&quot;multiplication of matrices is&quot;; for(i=0;i<row1;i++) { for(j=0;j<col1;j++) {
  • 52. multi[i][j]=0; for(k=0;k<col1;k++) { multi[i][j]+=mat1[i][k]*mat2[k][j]; } cout<<multi[i][j]; } cout<<endl; } } else cout<<&quot;multiplication is not compatible&quot;; getch(); }
  • 53.
  • 54.
  • 55. “ HAVE A NICE DAY”