SlideShare une entreprise Scribd logo
1  sur  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”

Contenu connexe

Tendances

Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Inline function
Inline functionInline function
Inline function
Tech_MX
 

Tendances (20)

Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
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
 
Class and object in c++
Class and object in c++Class and object in c++
Class and object in c++
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
 
Inline function
Inline functionInline function
Inline function
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
Java Notes
Java NotesJava Notes
Java Notes
 

Similaire à Oops ppt

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.ppt
citizen15
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
PadmaN24
 

Similaire à Oops ppt (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
 

Dernier

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Oops ppt

  • 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”