c++ file work
assignment - 1
question 1 : Discuss various type of programming approach. ?
Answer 1 : Most common programming paradigms:
Procedural programming paradigm – This paradigm emphasizes on procedure in terms of under lying machine model. There is no difference in between procedural and imperative approach. It has the ability to reuse the code and it was boon at that time when it was in use because of its reusability.
Object oriented programming –
The program is written as a collection of classes and object which are meant for communication. The smallest and basic entity is object and all kind of computation is performed on the objects only. More emphasis is on data rather procedure. It can handle almost all kind of real life problems which are today in scenario.
question 2 : Difference between conventional programming approach and object oriented programming approach.
answer 2 : Difference conventional programming approach and object oriented programming approch :
|
conventional Programming approach |
Object Oriented programming approch |
|
In procedural programming, program is divided
into small parts called functions. |
In object oriented programming, program is
divided into small parts called objects. |
|
Procedural programming follows top down approach. |
Object oriented programming follows bottom up approach. |
|
There is no access specifier in procedural
programming. |
Object oriented programming have access
specifiers like private, public, protected etc. |
|
Adding new data and function is not easy. |
Adding new data and function is easy. |
|
Procedural programming does not have any proper
way for hiding data so it is less secure. |
Object oriented programming provides data hiding
so it is more secure. |
|
In procedural programming, overloading is not
possible. |
Overloading is possible in object oriented
programming. |
|
In procedural programming, function is more
important than data. |
In object oriented programming, data is more
important than function. |
|
Procedural programming is based on unreal world. |
Object oriented programming is based on real world. |
|
Examples: C, FORTRAN, Pascal, Basic etc. |
Examples: C++, Java, Python, C# etc. |
question 3 : Discuss object oriented programming paradigm.
answer 3 :
Object-oriented programming (OOP) is a programming paradigm based upon objects (having both data and methods) that aims to incorporate the advantages of modularity and reusability. Objects, which are usually instances of classes, are used to interact with one another to design applications and computer programs.
The important features of object–oriented programming are −
- Bottom–up approach in program design
- Programs organized around objects, grouped in classes.
- Focus on data with methods to operate upon object’s data
- Interaction between objects through functions
- Reusability of design through creation of new classes by adding features to existing classes
Object-oriented programming aims to implement real-world entities like inheritance, hiding , polymorphism, etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.
· We can build the programs from standard working modules that communicate with one another, rather than having to start writing the code from scratch which lead to saving of development time and higher productivity.
· OOP language allows to break the program into the bit-sized problems that can be solved easily (one object at a time).
· The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost.
· OOP systems can be easily upgraded from small to large systems.
· It is possible that multiple instances of objects co-exist without any interference,
· It is very easy to partition the work in a project based on objects.
· It is possible to map the objects in problem domain to those in the program.
· The principle of data hiding helps the programmer to build secure programs which cannot be invaded by the code in other parts of the program.
· By using inheritance, we can eliminate redundant code and extend the use of existing classes.
· Message passing techniques is used for communication between objects which makes the
interface descriptions with external systems much simpler.
· The data-centered design approach enables us to capture more details of model in an
implementable form.
No comments:
Post a Comment