Procedure vs Object Oriented Programming Assignment Help

Assignment Help: >> Object Oriented Programming >> Procedure vs Object Oriented Programming

Procedure vs object oriented programming

       Conventional programming languages like C, COBOL etc use procedure oriented programming. In procedure oriented programming the problem is analyzed and broken down into series of actions that should be performed for solving the problem .For instance let us consider the problem of adding two integers. Then the series of actions include:

1. To input the two integers from the user.

2. Add the two integers.

3. Print or output the result to the user.

These actions are then organised and developed into different functions that are invoked in a sequential manner to accomplish the desired task i.e. adding two integers. In our case, we can have three different functions for the above three sub-tasks, one for taking the integers, the other for adding them and the third one for displaying the computed result and then invoking them in the same order. The programs are written in a top-down approach and this forms the main principle of procedure-oriented programming.

     One of the drawbacks of the procedure-oriented approach is the way in which data is defined and used. There are some local as well as global variables defined in a program. The global variables are freely accessible by all the functions in a program which becomes a nuisance when writing huge programs. Each of the function may modify the global data and it becomes really hard to detect a bug in the code. Another problem arises when some global data structure is modified. Then a modification has to be made in each of the functions and here is when bugs might creep in our code.

      Another problem with procedure-oriented programming is that they do not model real world problems very well. The major reason behind it is that the functions intended for solving the problems are action-oriented do not correspond to the elements of the problem i.e. here emphasis is on doing things rather than modeling the elements of the problem and then solve it by establishing communication between them.

       Let us consider the problem of generating result of students of a class. The elements of this problem are the different “students” and “result”. The corresponding attributes common to all the students will be defined and that for the generated result will be defined and the result is computed by performing communication between these elements.

 

       COMMUNICATION

      Fig 1:Object-Oriented representation of real world elements

    Unlike procedure oriented programming, object-oriented programming handles data more carefully and confidentially. As we can see that the elements as well as their corresponding attributes and functions are identified. These attributes are not accessible from the outside world which offers security of data. The attributes of the elements can be accessed only by the elements associated with it. However, functions of an element can access functions of another thereby enabling communication between the elements.(Later we will see that these elements have a great significance in OOP).The procedure discussed here is exactly the way in which problems are solved in OOP.

ExpertsMind.comC Programming Help, ExpertsMind.com - Procedure vs Object Oriented Programming Assignment Help, Procedure vs Object Oriented Programming Homework Help, Procedure vs Object Oriented Programming Assignment Tutors, Procedure vs Object Oriented Programming Solutions, Procedure vs Object Oriented Programming Answers, Object Oriented Programming Assignment Tutors
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd