PRINCIPLES OF OBJECT ORIENTED PROGRAMMING Procedure Oriented Programming
PRINCIPLES OF OBJECT ORIENTED PROGRAMMING. • Procedure Oriented Programming • A procedure oriented programming language is one in which procedure are given more significance. I. e. One method/function call another. • Task is divided in to smaller task or sub task. • Procedure oriented language followed top to bottom approach.
Disadvantage: • Difficult to trace which function are using data. • Error correction is to difficult • Example c programming
Basics of Object oriented programming: • Object oriented programming is related to object which has data and function built around it. • Data can be accessed with function • The function of one object can access the data of another object through the function of that object. • It uses bottom up approach • In object oriented programming smaller problem are first solve and then huge problem can be solved. • Example C++, Java, Ruby, C# Python are example.
Important terminology related to Object Oriented Programming Ø CLASS: – It is category of things. – Similar to structure but only additional data member with function. Ø Object: – It is an instance of class. – It is similar to variable.
Important terminology related to Object Oriented Programming Ø Data abstraction: – Abstraction is required parameter for object. – Ex. if there is class as circle we need to just define the radius of object of this class. Ø Data Encapsulation: – The data of an object is hidden from other object using encapsulation. – Encapsulation is achieved by putting data & function associated with it in to class. Ø Inheritance: - q The mechanism of deriving of the properties of one class in to another class known as inheritance Ø Polymorphism: - – Poly means multiple and morph means different form. i. e. multiple forms of the same thing.
Application of Object oriented programming • • • Real time system Simulation and modeling Object-oriented database. HTML & Hypermedia. AI & NN. CAD/CAM system.
C • C programming is structure programming • It is procedure oriented programming • Reliable simple easy to use. C++ • C++ is superset of c with additional of class. • C++ object oriented programming. • C++ bottom up approach
Simple C++ programming: • • #include<iostream> int main() { cout<<"Hello World!"; return 0; } Output: Hello World!
Benefits Of OOP • We can eliminate redundant code. • We can built program from standard working modules that communicate with one another. • The principal of data hiding help to provide secure program. • The data center design approach enables us to captures more details of module. • OOP system can be easily upgraded from small to large system.
Assignments -1 List any Four feature of POP Describe any 4 basics concept of oop List 4 OOP language Differentiate between POP & OOP Explain token in c & C++ Write & explain structure of C++ State & explain Scope & memory management operator in detail. • Describe syntax of Cin & Cout. • Write simple program to demonstrate of C++ structure. • •
- Slides: 10