 Hello everyone, this is Siddheesh Kumar Uttke here working as assistant professor in mechanical engineering department, Valtran Institute of Technology, Sholapur. Today we will be discussing about procedure oriented programming and object oriented programming. So, what do you mean by that? What happens in procedure oriented programming and what happens in object oriented programming? So we will be looking on to that. Learning outcome. At the end of this session, students will be able to understand and explain procedure oriented programming and object oriented programming. So, the following topics will be discussed in this video lecture. Procedure oriented programming, object oriented programming, procedure oriented programming. In this approach, the problem is viewed as a sequence of things to be done such as reading, calculating and printing. So sequence of things, it means sequence of actions. Actions like reading that is taking input from the user, calculating it means doing some mathematical calculation or any other calculation analytical methods and printing the output on the screen. A number of functions are returned to accomplish this task. Number of calculations I am writing to do some actions. So the sequence of things in the form of algorithms I am writing, step one, what are the steps to be followed and which step is the first step and second step. So all the procedure is written. So the primary focus is on functions. So this is the main thing in the procedure oriented programming. Figure shows the typical program structure for procedural programming. The technique of hierarchical decomposition used to specify the task to be completed for solving a problem. procedure oriented programming basically consists of writing a list of instructions for the computer to follow and organizing these instructions into groups known as functions. We normally use a flow chart to organize these actions and represent the flow of control from one action to another. While we concentrate on the development of functions, very little attention is given to the data that are being used by various functions. So what happens to the data? How were they affected by the functions that work on them? So in a multifunction program, many important data items are placed as global so that they may be accessed by all the functions. Each function may have its own local data. So in this, there are two global data and function one has some local data and function two has its own local data. Function three has its own local data. So in this, so the function one is function one, function two, function three is accessing the first global data and function one, function two is accessing the second global data. So there are two global data. So each function is accessing two global data simultaneously. So the figure shows the relationship of data and functions in a processor oriented program. Global data are more vulnerable to an inadvertent change by function. In the last program, it's very difficult to identify what data is used by which function. In case we need to revise external data structure, we also need to revise all the functions that access this data. This provides an opportunity for bugs to creep in, or errors to creep in, some stoppage. So the second another serious drawback with the procedural approach is that it does not model real world problem very well. This is because functions are action oriented and do not really correspond to the elements of the problem. Some of the brief outline features of procedure oriented programming are first, emphasis is on doing things. It means algorithms are written, second, large programs are divided into smaller programs known as functions. First of the functions share global data. Data openly moves around the system from one function to another function. It means data is shared between the function. So that we had seen in the function, different functions sharing the global data. Functions transform the data from one form to another. It employs top-down approach in program design. Object oriented programming. The motivating factor in the invention of object oriented approach is to remove some of the flows encountered in the procedure approach. Object oriented program treats data as a critical element in the program development and does not allow it to freely flow around the system. It ties data more closely to the functions that operate on it and protects it from accidental modification from outside functions. Object oriented programming allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Figure below shows the organization of data and functions in object oriented program. Object oriented programming is the most recent concept among programming approaches and still means different things to different people. It is therefore important to have a working definition of object oriented programming before we proceed further. So we can define object oriented programming as an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand. Thus an object is considered to be a partitioned area of computer memory that stores data and set of operation that can access this data. Since the memory partitions are independent the objects can be used in a variety of different programs without modification. So in this figure that three objects object A, object B, object C. Object A has its own data and functions. Object B has its own data and functions. Object C has its own data and functions. So if the object A function wants to access the data of object B then it has to communicate through objects then afterwards this message will be connected to object B function then the functions access that particular data and in this way the communication happens in object oriented programming. Some of the features of object oriented programming is that emphasis is on data rather than procedure. It means data is treated as a critical element rather than the actions taken rather than the algorithms written rather than the procedure written then the program is divided into what are known as objects. Data is hidden and cannot be accessed by external functions. Objects may communicate with each other through functions. New data and functions can be easily added whenever necessary. It follows bottom up approach in program design. Now pause this video for a few seconds and list down the advantages of an object oriented programming. Advantages is that reusability of the code afterwards it may be like encapsulation security are providing to the code through the objects and member functions approach. These are the following references. Object oriented programming with C++ by E Balaguru Swami. Thank you.