0% found this document useful (0 votes)
83 views

1 - Introduction, Need of Oop, Pop Vs Oop

This document outlines a course on object-oriented programming using C++. It discusses the unit on introduction, including the need for OOP, procedural programming versus object-oriented approaches, and programming paradigms. Procedural programming focuses on procedures or functions, while object-oriented programming models real-world objects. Key differences between procedural and object-oriented programming include top-down versus bottom-up flow, support for data abstraction, inheritance, overloading, and more.

Uploaded by

Karthik Sara M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

1 - Introduction, Need of Oop, Pop Vs Oop

This document outlines a course on object-oriented programming using C++. It discusses the unit on introduction, including the need for OOP, procedural programming versus object-oriented approaches, and programming paradigms. Procedural programming focuses on procedures or functions, while object-oriented programming models real-world objects. Key differences between procedural and object-oriented programming include top-down versus bottom-up flow, support for data abstraction, inheritance, overloading, and more.

Uploaded by

Karthik Sara M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SNS COLLEGE OF TECHNOLOGY

Coimbatore-35.
An Autonomous Institution

• COURSE NAME : 16CS451 OBJECT ORIENTED PROGRAMMING USING C++

• III YEAR/ V SEMESTER

• UNIT – I Introduction

• Topic: Introduction, Need for OOP, POP vs OOP

Mrs.S.R.Janani
Assistant Professor
Department of Computer Science and Engineering
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
How people are communicating with each other?

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 2/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
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.

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 3/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 4/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 5/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
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.

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 6/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 7/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Unit 1: Syllabus
Need for Object oriented programming
Procedural Languages vs. Object oriented approach
Characteristics Object oriented programming
C++ Programming Basics:
Basic Program Construction
Output Using cout
Input with cin
Data types
Variables and Constants
Operators
Control Statements
Manipulators
Type conversion
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 8/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Need for Object Oriented Programming

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 9/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Procedural vs. Object oriented approach
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.
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 10/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
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.

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 11/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
POP structure of C++ program
Example Program
Structure
/*Program to perform addition of two numbers*/
/*documentation*/ #include<iostream.h>

pre-processing statements int a, b;


void main()
global declaration;
{
void main() int c;
void get_data();
{
int sum(int, int);
Local declaration; get_data();
Executable statements; c = sum(a, b);
cout << "Sum = " << endl;
...
}
} void get_data()
User defined functions {
cout << "Enter any two numbers: ";
{ cin >> a >> b;
function body }
.. int sum(int a, int b)

} { return a + b; }

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 12/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
OOP structure of C++ program
Structure Example Program
/*documentation*/ /*Program to perform addition of two numbers*/
pre processing statements #include<iostream.h>
class Addition
class ClassName
{
{ int a, b;
member variable declaration; public: get_data()
... {
cout << "Enter any two numbers: ";
member functions()
cin >> a >> b;
{ }
function body int sum()
.. {
get_data();
} return a + b;
}; }

void main ()
};
void main()
{
{
ClassName object;
Addition obj;
object.member; cout << "Sum = " << sum() << endl;
} }

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 13/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Procedure-oriented Object-oriented
It is often known as POP (procedure-oriented It is often known as OOP (object-oriented
programming). programming).

It follows the top-bottom flow of execution. It follows the bottom-top flow of execution.

Larger programs have divided into smaller modules The larger program has divided into objects.
called as functions.

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 It has the concept of friend function and virtual
functions. functions.

Examples - C, FORTRAN Examples - C++ , Java , C#.net, Python, R


Programming, etc.

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 14/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED
08/23/2021 15/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
Assessment 1

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 16/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT
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.

Need for OOP, POP vs OOP /16CS451 OBJECT ORIENTED


08/23/2021 17/17
PROGRAMMING USING C++/Janani.S.R/CSE/SNSCT

You might also like