SlideShare a Scribd company logo
1 of 14
OBJECT ORIENTED
PROGRAMMING
USING C++
Introduction, Need of OOPs, POP vs OOP
Prof. Janani S R,
B.E (CSE), M.Tech (IT), Ph.D(ICE)
E
N
N
A
M
P
O
L
U
Y
A
R
V
U
How people are communicating with each other?
2ENNAM POL UYARVU
How communication between
User & Computer
Or
Computer & Computer
takes place?
Computer languages are the languages through which
the user can communicate with the computer by
writing program instructions.
3ENNAM POL UYARVU
4ENNAM POL UYARVU
What’s this?
Yes Computer languages to write code/program
5ENNAM POL UYARVU
Programming Paradigms
The programming paradigm
is the way of writing
computer programs
• Monolithic/Imperative
programming paradigm Assembly
language
• Structured-oriented programming
paradigm ALGOL, Pascal, PL/I and
Ada
• Procedural-oriented
programming paradigm C,
visual basic, FORTRAN, etc.
• Object-oriented programming
paradigm C++, Java, C#,
Python, etc.
6ENNAM POL UYARVU
Steps to create and execute C programs in the
Windows Operating System
Execution Process of a C Program
7ENNAM POL UYARVU
Need for Object Oriented Programming
8ENNAM POL UYARVU
Procedural Programming
• It can be defined as a
programming model which is
derived from structured
programming, based upon
the concept of calling
procedure.
• Procedures, also known as
routines, subroutines or
functions, simply consist of a
series of computational steps
to be carried out.
• During a program’s execution,
any given procedure might be
called at any point, including
by other procedures or itself.
9ENNAM POL UYARVU
Object Oriented Programming
• It can be defined as a programming
model which is based upon the
concept of objects.
• Objects contain data in the form of
attributes and code in the form of
methods.
• In object oriented programming,
computer programs are designed
using the concept of objects that
interact with real world.
• Object oriented programming
languages are various but the most
popular ones are class-based,
meaning that objects are instances of
classes, which also determine their
types.
10ENNAM POL UYARVU
POP structure of C++ program
Structure
/*documentation*/
pre-processing statements
global declaration;
void main()
{
Local declaration;
Executable statements;
. . .
}
User defined functions
{
function body
. .
}
Example Program
/*Program to perform addition of two numbers*/
#include<iostream.h>
int a, b;
void main()
{
int c;
void get_data();
int sum(int, int);
get_data();
c = sum(a, b);
cout << "Sum = " << endl;
}
void get_data()
{
cout << "Enter any two numbers: ";
cin >> a >> b;
}
int sum(int a, int b)
{ return a + b; }
11ENNAM POL UYARVU
OOP structure of C++ program
Structure
/*documentation*/
pre processing statements
class ClassName
{
member variable declaration;
. . .
member functions()
{
function body
. .
}
};
void main ()
{
ClassName object;
object.member;
}
Example Program
/*Program to perform addition of two numbers*/
#include<iostream.h>
class Addition
{
int a, b;
public: get_data()
{
cout << "Enter any two numbers: ";
cin >> a >> b;
}
int sum()
{
get_data();
return a + b;
}
};
void main()
{
Addition obj;
cout << "Sum = " << sum() << endl;
}
12ENNAM POL UYARVU
Procedure-oriented Object-oriented
It is often known as POP (procedure-oriented
programming).
It is often known as OOP (object-oriented programming).
It follows the top-bottom flow of execution. It follows the bottom-top flow of execution.
Larger programs have divided into smaller modules
called as functions.
The larger program has divided into objects.
The main focus is on solving the problem. The main focus is on data security.
It doesn’t support data abstraction. It supports data abstraction using access specifiers that
are public, protected, and private.
It doesn’t support inheritance. It supports the inheritance of four types.
Overloading is not supported. It supports the overloading of function and also the
operator.
There is no concept of friend function and virtual
functions.
It has the concept of friend function and virtual
functions.
Examples - C, FORTRAN Examples - C++ , Java , C#.net, Python, R Programming,
etc.
13ENNAM POL UYARVU
References
• Larry L. Peterson, Bruce S. Davie, “Computer Networks: A systems approach”, Fifth Edition,
Morgan Kaufmann Publishers, 2011.
• Behrouz A. Forouzan, “Data communication and Networking”, Fourth Edition, Tata McGraw
– Hill, 2011.
• James F. Kurose, Keith W. Ross, “Computer Networking - A Top-Down Approach Featuring
the Internet”, Fifth Edition, Pearson Education, 2009
• Nader. F. Mir, “Computer and Communication Networks”, Pearson Prentice Hall Publishers,
2010.
14ENNAM POL UYARVU

More Related Content

What's hot

Memory allocation in c
Memory allocation in cMemory allocation in c
Memory allocation in cPrabhu Govind
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++Ankur Pandey
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of cHarish Kumawat
 
x86 architecture
x86 architecturex86 architecture
x86 architecturei i
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instructionDeepikaT13
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constantsvinay arora
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statementnarmadhakin
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2MOHIT TOMAR
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 
input/ output in java
input/ output  in javainput/ output  in java
input/ output in javasharma230399
 

What's hot (20)

Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 
C basics
C   basicsC   basics
C basics
 
Memory allocation in c
Memory allocation in cMemory allocation in c
Memory allocation in c
 
C language
C languageC language
C language
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
 
x86 architecture
x86 architecturex86 architecture
x86 architecture
 
Introduction to the Python
Introduction to the PythonIntroduction to the Python
Introduction to the Python
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Packages and interfaces
Packages and interfacesPackages and interfaces
Packages and interfaces
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
input/ output in java
input/ output  in javainput/ output  in java
input/ output in java
 
Python ppt
Python pptPython ppt
Python ppt
 

Similar to Need of OOPs and Programming,pop vs oop

Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - IntroductionMadishetty Prathibha
 
Oop in c++ lecture 1
Oop in c++  lecture 1Oop in c++  lecture 1
Oop in c++ lecture 1zk75977
 
CHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptxCHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptxTSha7
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
Principles of object oriented programming
Principles of object oriented programmingPrinciples of object oriented programming
Principles of object oriented programmingAmogh Kalyanshetti
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaKim Moore
 
Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...Laura Martin
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programmingdkpawar
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingALI RAZA
 
PCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxPCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxvishnupriyapm4
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptxHeadoftheDepartment
 
Python Programming - I. Introduction
Python Programming - I. IntroductionPython Programming - I. Introduction
Python Programming - I. IntroductionRanel Padon
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 

Similar to Need of OOPs and Programming,pop vs oop (20)

Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
History Of C Essay
History Of C EssayHistory Of C Essay
History Of C Essay
 
Oop in c++ lecture 1
Oop in c++  lecture 1Oop in c++  lecture 1
Oop in c++ lecture 1
 
CHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptxCHAPTER 2 object oriented programming.pptx
CHAPTER 2 object oriented programming.pptx
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
chapter-6-oops.pdf
chapter-6-oops.pdfchapter-6-oops.pdf
chapter-6-oops.pdf
 
Principles of object oriented programming
Principles of object oriented programmingPrinciples of object oriented programming
Principles of object oriented programming
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
 
Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programming
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Introduction to programing languages part 1
Introduction to programing languages   part 1Introduction to programing languages   part 1
Introduction to programing languages part 1
 
PCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxPCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptx
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptx
 
Python Programming - I. Introduction
Python Programming - I. IntroductionPython Programming - I. Introduction
Python Programming - I. Introduction
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 

Need of OOPs and Programming,pop vs oop

  • 1. OBJECT ORIENTED PROGRAMMING USING C++ Introduction, Need of OOPs, POP vs OOP Prof. Janani S R, B.E (CSE), M.Tech (IT), Ph.D(ICE) E N N A M P O L U Y A R V U
  • 2. How people are communicating with each other? 2ENNAM POL UYARVU
  • 3. How communication between User & Computer Or Computer & Computer takes place? Computer languages are the languages through which the user can communicate with the computer by writing program instructions. 3ENNAM POL UYARVU
  • 5. What’s this? Yes Computer languages to write code/program 5ENNAM POL UYARVU
  • 6. Programming Paradigms The programming paradigm is the way of writing computer programs • Monolithic/Imperative programming paradigm Assembly language • Structured-oriented programming paradigm ALGOL, Pascal, PL/I and Ada • Procedural-oriented programming paradigm C, visual basic, FORTRAN, etc. • Object-oriented programming paradigm C++, Java, C#, Python, etc. 6ENNAM POL UYARVU
  • 7. Steps to create and execute C programs in the Windows Operating System Execution Process of a C Program 7ENNAM POL UYARVU
  • 8. Need for Object Oriented Programming 8ENNAM POL UYARVU
  • 9. Procedural Programming • It can be defined as a programming model which is derived from structured programming, based upon the concept of calling procedure. • Procedures, also known as routines, subroutines or functions, simply consist of a series of computational steps to be carried out. • During a program’s execution, any given procedure might be called at any point, including by other procedures or itself. 9ENNAM POL UYARVU
  • 10. Object Oriented Programming • It can be defined as a programming model which is based upon the concept of objects. • Objects contain data in the form of attributes and code in the form of methods. • In object oriented programming, computer programs are designed using the concept of objects that interact with real world. • Object oriented programming languages are various but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types. 10ENNAM POL UYARVU
  • 11. POP structure of C++ program Structure /*documentation*/ pre-processing statements global declaration; void main() { Local declaration; Executable statements; . . . } User defined functions { function body . . } Example Program /*Program to perform addition of two numbers*/ #include<iostream.h> int a, b; void main() { int c; void get_data(); int sum(int, int); get_data(); c = sum(a, b); cout << "Sum = " << endl; } void get_data() { cout << "Enter any two numbers: "; cin >> a >> b; } int sum(int a, int b) { return a + b; } 11ENNAM POL UYARVU
  • 12. OOP structure of C++ program Structure /*documentation*/ pre processing statements class ClassName { member variable declaration; . . . member functions() { function body . . } }; void main () { ClassName object; object.member; } Example Program /*Program to perform addition of two numbers*/ #include<iostream.h> class Addition { int a, b; public: get_data() { cout << "Enter any two numbers: "; cin >> a >> b; } int sum() { get_data(); return a + b; } }; void main() { Addition obj; cout << "Sum = " << sum() << endl; } 12ENNAM POL UYARVU
  • 13. Procedure-oriented Object-oriented It is often known as POP (procedure-oriented programming). It is often known as OOP (object-oriented programming). It follows the top-bottom flow of execution. It follows the bottom-top flow of execution. Larger programs have divided into smaller modules called as functions. The larger program has divided into objects. The main focus is on solving the problem. The main focus is on data security. It doesn’t support data abstraction. It supports data abstraction using access specifiers that are public, protected, and private. It doesn’t support inheritance. It supports the inheritance of four types. Overloading is not supported. It supports the overloading of function and also the operator. There is no concept of friend function and virtual functions. It has the concept of friend function and virtual functions. Examples - C, FORTRAN Examples - C++ , Java , C#.net, Python, R Programming, etc. 13ENNAM POL UYARVU
  • 14. References • Larry L. Peterson, Bruce S. Davie, “Computer Networks: A systems approach”, Fifth Edition, Morgan Kaufmann Publishers, 2011. • Behrouz A. Forouzan, “Data communication and Networking”, Fourth Edition, Tata McGraw – Hill, 2011. • James F. Kurose, Keith W. Ross, “Computer Networking - A Top-Down Approach Featuring the Internet”, Fifth Edition, Pearson Education, 2009 • Nader. F. Mir, “Computer and Communication Networks”, Pearson Prentice Hall Publishers, 2010. 14ENNAM POL UYARVU