Therefore, a program in the procedural language is a list instruction which is suitable for small programs.
Program may become larger and complex difficult to manage, so there is necessary of breaking down the program into smaller units. So for this reason the function is adopted, the function in different languages called as subroutine, module, subprogram or it may called as procedure.
There the procedural program is divided into functions and the idea of breaking a program into function can be further extended by grouping a number of functions together into a larger entity called as module. Dividing a program into smaller function and module is one of the core concept of the structured programming..
“Divide and Conquer”
Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.
OOPs has lots of features and characteristics the list is given,
Focuses on the outside view of an object and so serves to separate an object’s essential behavior from its implementation. It is the important concept if including encapsulation, inheritance and polymorphism.
The polymorphism came from “Greek” word ‘poly’ and ‘morphs’ where poly means ‘many’ and morphs means ‘forms’. In OOP is the flow of a message in many forms it allows different objects to respond to the same message in different forms for example Date of Birth.
- is-a: is-a relationship exist between two component or concept when the first is the specialized instance of the second i.e dog is a mammal.
- has-a: It exist when second component or concept is the part of the first one i.e car has an engine.
Overloaded methods are generally used when they conceptually execute the same task but with a slightly different set of parameters. The original method get called as the compile time and that helps to resolve the complexity of the program and code clarity, avoid errors and faster execution.
int a(int s),
double a(double r, int h),
long a(long l, int b, int h)
The overridden method or function should have the same name, signature, and parameters as the one in its parent class. In C++, the base class member can be overridden by the derived class function with the same signature as the base class function.
Method overriding is used to provide different implementations of a function so that a more specific behavior can be realized.
Dynamic Binding known as linking a procedure call to the code that will be executed only at run time, It means that the code to be executed for a specific procedure call is not known until run-time. Dynamic binding is also known as late binding or run-time binding.
The interaction among objects in between functions not the data. The interaction between the objects is possible through message passing i.e communicate using message. Object interact with each other using message.
Object Oriented Approach
Where as object functions are known as member functions and object data is known as data members. If you want to read a data item in an object then you will call a member function on that object. It will access the data and return the value to you.
Data and functions are said to be encapsulated into a single entity. Data are hidden , which means that there you can’t access the data directly. If you want to modify the data of an object you need to know which function interact with it.
The C++ program typically consists no of objects which communicate with each other by calling one another member function. Calling an object’s member function referred as sending the message to the object.