You are on page 1of 25

Difference Between

Object Oriented
&
Structure Programming

Presenter Junaid Khan


Department of Computer Science University
of Peshawar Pakistan
Junaid_upesh@yahoo.com
Topic Included………
 Object Oriented Programming
 Features…
 Structure Programming
 Features…
 Difference b/w Structure & Object
Oriented Programming
Object Oriented Programming…
 Object Oriented Programming Is
Programming Technique In Which
Program Is Written On The Bases Of
Object.
 Object May Represent a Person,Thing
or Place Of Real World.
 In OOP,Object Is a Collection Of Data
& Function.
Object Oriented Programming…
 In OOP,Data & All Possible Function
On Data Are Grouped Together.

 OOP Is Easy To Learn & Modify.

 OOP Is Power Full Technique To


Develope Software.
Object Oriented Programming…
 Some Object Oriented Languages
1. C++
2. Java
3. Smalltalk
4. Eiffel
5. CLOS
FEATURES………
 OBJECT:-
 OOP Provide The Facility Of
Programming Based On Object .
 Object Is Entity That Consist Of Data
& Function.
 CLASSES:-
 Classes Are For Creating Object.
FEATURES………
 OOP Provides Facility To Design Classes For
Creating Different Object.
 All The Properties & Function Of An Object
Are Specified In Classes.
 REAL WORLD MODELING
 OOP Is Based On Real World Modeling.

 As In Real World Modeling,Things Have


Some Properties & Working Capabilities.
FEATURES…………
 An Object Have Data & Function.Data
Represent Properties & Function Represent
Working Of Object.
 REUSABILITY
 OOP Provide a Way To Reuse The Code &
Data.
 In OOP,Inheritance Is a technique In Which
a Programer Used The Code of Existing
Program For Creating a New Program.
FEATURES………
 INFORMATION
HIDING/ENCAPSULATION:-
 OOP Allows The Programmer To Hide The
Important Data From The User.
 In OOP It Is Performed By Encapsulation.
 POLYMORPHISM:-
 Polymorphism Is An Ability Of An Object
To Behave In Multiple Ways.
 STRUCTURE PROGRAMMING
Structure Programming……
 Structure Programming Is a Programming
Technique In Which Program Are Divided
Into Small Units Called Module Or
Subprogram.
 In Structure Programming Each Module
Consist Of Instruction To Perform A Specific
Task.
 In Structure Programming Module Is
Executed When A Main Program Call it.
Structure Programming…….
 In Structure Programming When a
Module Is call,the Control Is Move To
The Called Module Temporarily &
After Executing the Instruction Of
Module, Control Is Move Back To the
Main Program.
Structure Programming…….
 Structure Programming Makes
Programes easier to Write,check,read
and modify.
 Structure Programming Uses three
types of instruction technique
1. Sequential Structure
2. Conditional/Selective Structure.
3. Iterative/Repeatitive Structure.
Structure Programming…….
 Sequential Structure:-
 In Sequential Structure,all the
statement are executed in the same
order in which they are specified in
program.

stmt_1 Stmt_2 Stmt_3 Stmt_4 Stmt_5


Structure Programming…….
 Conditional Structure:-
 A Conditional Structure,selects a
statement or set of statement to
execute on the basis of condition.
o n
iti
n d
co
Stmt_1 Stmt_2
Structure Programming…….
 Iterative Structure:-
 An iterative structure a statement or
set of statement are executed
repeatedly. co
nd
iti
on
FEATURES…..
Reusability:-
 Structured Programming allows the

users to reuse existing code


whenever it is required.
 You can use this code again and

again without writing the same code


again.
FEATURES…..
 EASIER TO CODE:-
 It is easier to write small block of
code instead of long program as
whole.
 You can focus your attention on a
specific problem in a particular block.
FEATURES…..
 EASIER TO MODIFY & MAINTAIN:-
 Each block of code has a uniqe name &
written separately in a block,so it easier to
modify small block of code as compared a
long program.
 Small block are comparatively easier to
maintain as compared to long program b/c
each block of indepented so any change
doesn,t effect other block.
Example……..
Add(int a,int b) Int sbtrct(int w,int z)
Sbtrct(int c,int d) {int sub=0;
Void main() Sub=w-z;
{ Return sub;
Int sum=0,sub=0,mul=0; }
Printf(“Your Addition Is”);
Sum=add(2,3);
Printf(“sum=“sum);
Printf(“Your Subtraction reuslt’);
Sub=sbtrct(5,3);
Printf(“subtraction=“sub);
}
Int add(int x,int y)
{int sum=0;
Sum=x+y;
Return sum;}
Difference Between

Object Oriented
&
Structure Programming
Difference B/W Structured & OOP
Structure Programing Object-Oriented

is a programming programming is a
technique in which programming
programs are divided technique in which
into small unit called programs are written
module or on the basis of Object.
subprogram. In OOP,there is big
In structure concept of classes &
progamming,there is object.
no concept of classes
& object.
Difference B/W Structured & OOP
Structure Object Oriented
Programming doesn,t Programming,support
support the user the user defined data
defined data types. types.
Structure Object Oriented

programming is not Programming,is widely


widely used as used as compared to
compared to OOP. Structure
Programming.
Difference B/W Structured & OOP
Sturcture Object Oriented
Programming is easier Programming is tough
as compared to OOP. as compared to
Struture Structure
Programming is Programming.
typically file oriented It is typically Object-

Programming. Oriented
Programming.
Difference B/W Structured & OOP
There is no concept There is Big concept f
of polymorphism & polymorphism &
encapsulation in encapsulation in OOP.
Structure Example of Object-
Programming. Oriented Programming
Example of Structure Languages are
Programming JAVA,C+
Languages are +,Smaslltalk,Eiffels,CL
FORTRAN,BASIC, OS.
COBOL,PASCAL,C

You might also like